schedule

abstract fun schedule(adItem: AdItem)

Schedules the adItem for playback.

Note: Scheduling may require resolving ad inventory and timing first. Therefore, updates to schedule can happen after this method returns. Use PlayerEvent.AdScheduleChanged to observe schedule updates.

Has no effect if:

  • there is no active playback session

  • connected to a cast-compatible device


abstract val schedule: List<AdBreak>

The current ad schedule of the active playback session.

Note: This value reflects resolved upcoming AdBreaks and is updated via the normal scheduling flow (see PlayerEvent.AdScheduleChanged).

Returns an empty list if there is no active playback session or no ads are scheduled.

The list does not contain AdBreaks for which the exact schedule time is not known yet, like for post rolls, when the content duration is not known yet. It further only lists upcoming AdBreak, and thus does not include the currently active AdBreak.

For IMA VAMP ads, the single ad breaks are not known until shortly before they should play. As a consequence, these ad breaks are also not included in this list.