PlaybackPolicyHandler

Handler interface that enforces the policies related to the content with ads, and promos where special handling is required for seeking, timeline adjustment, interrupt handling etc.

Types

Link copied to clipboard
interface Listener

The listener that provides the notification for ad playback policy related events.

Properties

Link copied to clipboard
Link copied to clipboard

Sets the AdTrackingEvent instance based on the current Ad Playback Session lifecycle.

Link copied to clipboard

Sets a listener to receive ad playback policy related events during ad playback. The listener's methods will be called on the UI thread.

Link copied to clipboard
abstract var player: Player

The Player instance that this PlaybackPolicyHandler is associated with.

Functions

Link copied to clipboard
abstract fun getContentDuration(): Long

Determines a content duration discounting the sum of all ad break durations.

Link copied to clipboard
abstract fun getContentPositionForPlayhead(playheadMs: Long): Long

Determines a relative content playhead position, discounting the sum of all ad break durations prior to the absolute playhead position provided. This allows the client to return to the same content position if a VOD stream is stopped before playback ends.

Link copied to clipboard
abstract fun getPlayheadForContentPosition(positionMs: Long): Long

Determines an absolute playhead position calculating the sum of all ad break durations prior to that absolute playhead position plus the relative content playhead position. This allows the client to return to the same content position if a VOD stream is stopped before playback ends.

Link copied to clipboard
abstract fun playbackInterrupted()

Notifies the PlaybackPolicyHandler implementation that the playback was interrupted e.g. Phone Call etc.

Link copied to clipboard
abstract fun resolveSeekIntent(positionMs: Long, seekPreference: SeekPreference? = null)

Solicits to seek to the desired time position. This is just providing the player's seek position intent since the real seek position needs to be determined by the ad playback rules (a.k.a. scrub management policies). For example: A user may scrub over one/several Ad Breaks but on resume of the video play:

Link copied to clipboard

Provides the timeline of all ad breaks that drives policy rules handling.