TXVodPlayer, LiteAV), one call and one line in your play listener give the SDK all of that.
Add the adapter
- Player SDK 11.0 or later (
TXVodPlayer, any LiteAV edition that has it). - The Player SDK is not included. The adapter uses your app’s own Player SDK, with your license; it adds no LiteAV artifact to your build.
- R8: the adapter needs no rules from you. Keep the Player SDK’s own rule from its integration guide (
-keep class com.tencent.** { *; }): a minified app without it aborts when it creates a player.
Track the player
startVodPlay), when the episode starts. The SDK holds the player weakly and lets go at ads.destroy() or the next track.
currentItem is optional: your episode on this player (its id), for a player that plays several episodes one after another. Without it the player is the episode. Either way, playing the video to its end, or a loop’s next round, counts as another play.
Hand on the play events
ATXVodPlayer has one listener, yours (setVodListener), so the SDK does not take it. Hand each play event on from your onPlayEvent, as given:
isPlaying(), and infers seeks from the position. An event for a player no VideoAds tracks is ignored, so forward every event of every player.
In a feed
Short-drama feeds usually give each page its ownTXVodPlayer. Give each page its own VideoAds, and track the page’s player once it has its source:
INTERRUPTED), so the next page’s ad can show. A neighbour page prepared ahead and paused is not playing, so no overlay shows over it.
Pause and buffering
The Player SDK sends no event for a pause. The SDK readsisPlaying() four times a second while an overlay or pause ad is on screen, and at every show, so an overlay ends within a quarter of a second of pause(). isPlaying() stays true while the player stalls to load, so buffering counts as playing and an overlay stays.
The playback speed
The Player SDK has no getter for the speed. When the viewer changes it (setRate), tell the SDK, so an overlay’s duration counts video seconds correctly:
What the SDK reads
An overlay or pause ad of a
VideoAds then throws Invalidated(ContentChanged) at show once its player plays another episode or plays this one again.