ExoPlayer, MediaController), add so.kontext:video-media3 and hand it over; see Media3 player:
TTVideoEngine), add so.kontext:video-ttsdk and hand over the engine the same way, ads.track(engine); see TTSDK player.
With a Tencent Cloud Player SDK player (TXVodPlayer), add so.kontext:video-txplayer, call ads.track(player) and hand on your play events with KontextTXVodPlayer.onPlayEvent(player, event); see Tencent Cloud Player.
With any other player, implement ContentPlayer: its position in milliseconds, and whether it plays. Buffering and seeking count as playing.
addListener and removeListener and call the ContentPlayer.Listener on each change (onIsPlayingChanged, onSeek, onContentChanged): an overlay then ends the moment the viewer pauses. Otherwise the SDK checks isPlaying four times a second while an overlay is on screen. The SDK holds the adapter until destroy() or the next track, so let the adapter hold your player weakly.
If your player can tell which episode it plays, return it as currentItem (your item or its id; a new value for a loop’s next play). The SDK compares it with the value at track: once it differs, this episode’s overlay and pause ads throw Invalidated(ContentChanged) at show, and one on screen ends with INTERRUPTED.
Call track when this episode starts playing, not when you create the VideoAds: until then the player’s time belongs to the previous episode. Before that the SDK sends 0, which is right for a prefetch.