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 any other player, implement VideoAdsPlayer: its position in milliseconds, and whether it plays. Buffering and seeking count as playing.
addListener and removeListener and call the VideoAdsPlayer.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.
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.