HlsInterstitialsAdsLoader.Listener


interface HlsInterstitialsAdsLoader.Listener


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

Summary

Public functions

Unit
onAdCompleted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
)

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

Unit
onAssetListLoadCompleted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    assetList: HlsInterstitialsAdsLoader.AssetList!
)

Called when an asset list has completed to load for the given ad.

Unit
onAssetListLoadFailed(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    ioException: IOException?,
    cancelled: Boolean
)

Called when an asset list has failed to load for the given ad.

Unit
onAssetListLoadStarted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
)

Called when the asset list has been started to load for the given ad.

Unit
onContentTimelineChanged(
    mediaItem: MediaItem!,
    adsId: Any!,
    hlsContentTimeline: Timeline!
)

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

Unit
onMetadata(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    metadata: Metadata!
)

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

Unit
onPrepareCompleted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
)

Called when preparation of an ad period has completed successfully.

Unit
onPrepareError(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    exception: IOException!
)

Called when preparation of an ad period failed.

Unit
onStart(mediaItem: MediaItem!, adsId: Any!, adViewProvider: AdViewProvider!)

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

Unit
onStop(mediaItem: MediaItem!, adsId: Any!, adPlaybackState: AdPlaybackState!)

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

Public functions

onAdCompleted

fun onAdCompleted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
): Unit

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.

adsId: Any!

The ads identifier (see adsId).

adGroupIndex: Int

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

adIndexInAdGroup: Int

The index of the ad in the ad group.

onAssetListLoadCompleted

fun onAssetListLoadCompleted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    assetList: HlsInterstitialsAdsLoader.AssetList!
): Unit

Called when an asset list has completed to load for the given ad.

Parameters
mediaItem: MediaItem!

The MediaItem with which the content media source was created.

adsId: Any!

The ads identifier (see adsId).

adGroupIndex: Int

The index of the ad group of the ad period.

adIndexInAdGroup: Int

The index of the ad in the ad group of the ad period.

assetList: HlsInterstitialsAdsLoader.AssetList!

The AssetList for which loading has completed.

onAssetListLoadFailed

fun onAssetListLoadFailed(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    ioException: IOException?,
    cancelled: Boolean
): Unit

Called when an asset list has failed to load for the given ad.

Parameters
mediaItem: MediaItem!

The MediaItem with which the content media source was created.

adsId: Any!

The ads identifier (see adsId).

adGroupIndex: Int

The index of the ad group of the ad period.

adIndexInAdGroup: Int

The index of the ad in the ad group of the ad period.

ioException: IOException?

The exception, may be null if cancelled.

cancelled: Boolean

Whether the load was cancelled.

onAssetListLoadStarted

fun onAssetListLoadStarted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
): Unit

Called when the asset list has been started to load for the given ad.

Parameters
mediaItem: MediaItem!

The MediaItem with which the content media source was created.

adsId: Any!

The ads identifier (see adsId).

adGroupIndex: Int

The index of the ad group of the ad period.

adIndexInAdGroup: Int

The index of the ad in the ad group of the ad period.

onContentTimelineChanged

fun onContentTimelineChanged(
    mediaItem: MediaItem!,
    adsId: Any!,
    hlsContentTimeline: Timeline!
): Unit

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.

adsId: Any!

The ads identifier (see adsId).

hlsContentTimeline: Timeline!

The latest Timeline.

onMetadata

fun onMetadata(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    metadata: Metadata!
): Unit

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.

adsId: Any!

The ads identifier (see adsId).

adGroupIndex: Int

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

adIndexInAdGroup: Int

The index of the ad in the ad group.

metadata: Metadata!

The emitted Metadata.

onPrepareCompleted

fun onPrepareCompleted(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
): Unit

Called when preparation of an ad period has completed successfully.

Parameters
mediaItem: MediaItem!

The MediaItem of the content media source.

adsId: Any!

The ads identifier (see adsId).

adGroupIndex: Int

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

adIndexInAdGroup: Int

The index of the ad in the ad group.

onPrepareError

fun onPrepareError(
    mediaItem: MediaItem!,
    adsId: Any!,
    adGroupIndex: Int,
    adIndexInAdGroup: Int,
    exception: IOException!
): Unit

Called when preparation of an ad period failed.

Parameters
mediaItem: MediaItem!

The MediaItem of the content media source.

adsId: Any!

The ads identifier (see adsId).

adGroupIndex: Int

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

adIndexInAdGroup: Int

The index of the ad in the ad group.

exception: IOException!

The IOException thrown when preparing.

onStart

fun onStart(mediaItem: MediaItem!, adsId: Any!, adViewProvider: AdViewProvider!): Unit

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.

adsId: Any!

The ads identifier (see adsId).

adViewProvider: AdViewProvider!

Provider of views for the ad UI.

onStop

fun onStop(mediaItem: MediaItem!, adsId: Any!, adPlaybackState: AdPlaybackState!): Unit

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

Parameters
mediaItem: MediaItem!

The MediaItem of the content media source.

adsId: Any!

The ads identifier (see adsId).

adPlaybackState: AdPlaybackState!

The AdPlaybackState after the ad media source was released.