Skip to main content
Every request and event carries where the viewer is in the episode, and overlay and pause ads follow the playback: an overlay shows over playing content only and goes away when the viewer pauses; a pause ad goes away when the content plays again after a pause seen while the ad is on screen, however the viewer resumed it. Give the SDK your player once the episode starts playing. With a Media3 player (ExoPlayer, MediaController), add so.kontext:video-media3 and hand it over; see Media3 player:
With a TTSDK 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.
If your player has its own listeners, implement 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.