HlsInterstitialsAdsLoader.Listener


public interface HlsInterstitialsAdsLoader.Listener


A listener to be notified of events emitted by the ads loader.

Summary

Public methods

default void
onAdCompleted(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup
)

Called when an ad period has completed playback and transitioned to the following ad or content period, or the playlist ended.

default void
onContentTimelineChanged(
    MediaItem mediaItem,
    Object adsId,
    Timeline hlsContentTimeline
)

Called when the timeline of the content media source has changed.

default void
onMetadata(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup,
    Metadata metadata
)

Called when Metadata is emitted by the player during an ad period of an active HLS media item.

default void
onPrepareCompleted(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup
)

Called when preparation of an ad period has completed successfully.

default void
onPrepareError(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup,
    IOException exception
)

Called when preparation of an ad period failed.

default void
onStart(
    MediaItem mediaItem,
    Object adsId,
    AdViewProvider adViewProvider
)

Called when the ads loader was started for the given HLS media item and ads ID.

default void
onStop(
    MediaItem mediaItem,
    Object adsId,
    AdPlaybackState adPlaybackState
)

Called when the ads loader was stopped for the given HLS media item.

Public methods

onAdCompleted

default void onAdCompleted(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup
)

Called when an ad period has completed playback and transitioned to the following ad or content period, or the playlist ended.

Parameters
MediaItem mediaItem

The MediaItem of the content media source.

Object adsId

The ads ID of the ads media source.

int adGroupIndex

The index of the ad group in the ad media source.

int adIndexInAdGroup

The index of the ad in the ad group.

onContentTimelineChanged

default void onContentTimelineChanged(
    MediaItem mediaItem,
    Object adsId,
    Timeline hlsContentTimeline
)

Called when the timeline of the content media source has changed. The HlsManifest of the content source can be accessed through manifest.

Parameters
MediaItem mediaItem

The MediaItem of the content media source.

Object adsId

The ads ID of the ads media source.

Timeline hlsContentTimeline

The latest Timeline.

onMetadata

default void onMetadata(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup,
    Metadata metadata
)

Called when Metadata is emitted by the player during an ad period of an active HLS media item.

Parameters
MediaItem mediaItem

The MediaItem of the content media source.

Object adsId

The ads ID of the ads media source.

int adGroupIndex

The index of the ad group in the ad media source.

int adIndexInAdGroup

The index of the ad in the ad group.

Metadata metadata

The emitted Metadata.

onPrepareCompleted

default void onPrepareCompleted(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup
)

Called when preparation of an ad period has completed successfully.

Parameters
MediaItem mediaItem

The MediaItem of the content media source.

Object adsId

The ads ID of the ads media source.

int adGroupIndex

The index of the ad group in the ad media source.

int adIndexInAdGroup

The index of the ad in the ad group.

onPrepareError

default void onPrepareError(
    MediaItem mediaItem,
    Object adsId,
    int adGroupIndex,
    int adIndexInAdGroup,
    IOException exception
)

Called when preparation of an ad period failed.

Parameters
MediaItem mediaItem

The MediaItem of the content media source.

Object adsId

The ads ID of the ads media source.

int adGroupIndex

The index of the ad group in the ad media source.

int adIndexInAdGroup

The index of the ad in the ad group.

IOException exception

The IOException thrown when preparing.

onStart

default void onStart(
    MediaItem mediaItem,
    Object adsId,
    AdViewProvider adViewProvider
)

Called when the ads loader was started for the given HLS media item and ads ID.

Parameters
MediaItem mediaItem

The MediaItem of the content media source.

Object adsId

The ads ID of the ads media source.

AdViewProvider adViewProvider

Provider of views for the ad UI.

onStop

default void onStop(
    MediaItem mediaItem,
    Object adsId,
    AdPlaybackState adPlaybackState
)

Called when the ads loader was stopped for the given HLS media item.

Parameters
MediaItem mediaItem

The MediaItem of the content media source.

Object adsId

The ads ID of the ads media source.

AdPlaybackState adPlaybackState

The AdPlaybackState after the ad media source was released.