Skip to main content
The SDK follows your content player: where the viewer is in the episode, and whether the content plays. An overlay shows over playing content only and ends when the viewer pauses; a pause ad ends when the content plays again. With a Media3 player, one call gives the SDK all of that.

Add the adapter

It works with Media3 1.1 or later and uses your app’s own Media3 version: adding it never changes the Media3 your app resolves.

Track the player

  • Any Media3 Player: an ExoPlayer, a MediaController, or your own Player.
  • The main looper: the SDK reads the player on the main thread. A player built on another looper is not followed (an error in the log), and the content counts as not playing.
  • Held weakly: the SDK never keeps your player alive. It lets go at ads.destroy() or the next track.

One player across episodes

Most apps reuse one player and swap its media item. Track it from each episode’s VideoAds once that episode is in the player:
Tracked before setMediaItem, the new episode’s overlay and pause ads throw Invalidated(ContentChanged) at show: the SDK took the previous item for this episode’s. Track again after setMediaItem and they show.

What the SDK reads

The adapter listens to the player’s own callbacks, so an overlay ends the moment the viewer pauses.

Ads inserted by the player

If your player also plays ads itself (an ads loader, server-inserted ads), the time in those ads is not content: an overlay is not shown over them, and the position the SDK reads stays the content’s.