Package-level declarations

Contains API to enable advertising workflows.

Types

Link copied to clipboard
interface Ad

Defines basic properties available for every ad type

Link copied to clipboard
interface AdBreak : AdConfig

Contains information about an ad break.

Link copied to clipboard

Contains configuration options for an AdBreak.

Link copied to clipboard
interface AdConfig

Contains the base configuration options for an ad.

Link copied to clipboard
interface AdData

Holds various additional ad data.

Link copied to clipboard
data class AdItem(val sources: Array<AdSource>, val position: String = DEFAULT_POSITION, val replaceContentDuration: Double = DEFAULT_REPLACE_CONTENT_DURATION, val preloadOffset: Double = DEFAULT_PRELOAD_OFFSET, val bitmovinAdTagLoading: Boolean = false, val discardPolicy: AdItemDiscardPolicy = AdItemDiscardPolicy.DiscardAfterAttempt) : Parcelable

Represents an ad break which can be scheduled for playback.

Link copied to clipboard

How an attempt to play an AdItem ended.

Link copied to clipboard

Describes how an attempt to play an AdItem ended, and what the player does with the AdItem by default.

Link copied to clipboard

What happens to an AdItem once an attempt to play it ended.

Link copied to clipboard
sealed interface AdItemDiscardPolicy : Parcelable

Determines the default AdItemDiscardDecision for an AdItem once an attempt to play it ended, for any AdItemAttemptOutcome. AdvertisingConfig.shouldDiscardAdItem receives it as AdItemDiscardContext.discardPolicyDecision and can override it.

Link copied to clipboard
Quartiles that can be reached during an ad playback.
Link copied to clipboard

Can be implemented to gain access to the currently used IMA AdsManager.

Link copied to clipboard
data class AdSource @JvmOverloads constructor(val type: AdSourceType, val tag: String, val vastLoadTimeout: Double = DEFAULT_VAST_LOAD_TIMEOUT, val videoLoadTimeout: Double = DEFAULT_VIDEO_LOAD_TIMEOUT) : Parcelable

Represents an ad source which can be assigned to an AdItem. An AdItem can have multiple AdSources as waterfalling option.

Link copied to clipboard
@Serializable
enum AdSourceType : Parcelable, Enum<AdSourceType>

The available types an AdSource can have.

Link copied to clipboard
class AdTag(val url: String, val type: AdTagType)

Defines the url and type of an ad manifest.

Link copied to clipboard
interface AdTagConfig : AdConfig

Contains configuration options for an AdTag.

Link copied to clipboard

Types that can be specified for an AdTag.

Link copied to clipboard
interface AdvertisingApi

Provides the means to interact with advertising features. Accessible through Player.ads.

Link copied to clipboard
data class AdvertisingConfig(val schedule: List<AdItem> = emptyList(), val companionAdContainers: List<CompanionAdContainer>? = null, var adsManagerAvailableCallback: AdsManagerAvailableCallback? = null, var beforeInitialization: BeforeInitializationCallback? = null, val imaUiElements: List<ImaUiElement>? = null, val ima: ImaConfig = ImaConfig(), val bitmovin: BitmovinAdvertisingConfig = BitmovinAdvertisingConfig(), val shouldPlayAdBreak: ShouldPlayAdBreakCallback = ShouldPlayAdBreakCallback { true }, val shouldLoadAdItem: ShouldLoadAdItemCallback = ShouldLoadAdItemCallback { true }, val shouldPlaySeekedOverAdItems: ShouldPlaySeekedOverAdItemsCallback? = null, val enableGaplessAdPlayback: Boolean = false, val shouldDiscardAdItem: ShouldDiscardAdItemCallback = ShouldDiscardAdItemCallback { _, context -> context.discardPolicyDecision }) : Parcelable

Contains configuration values regarding the ads which should be played back by the player.

Link copied to clipboard

A callback to be invoked before IMA initialization, exposing the IMA settings.

Link copied to clipboard
data class CompanionAdContainer(val container: ViewGroup, val width: Int, val height: Int)
Link copied to clipboard
interface LinearAd : Ad

Defines a linear ad which requires the playback of the content to stop

Link copied to clipboard
data class LinearAdUiConfig(val requestsUi: Boolean)
Link copied to clipboard
interface NonLinearAd : Ad

Defines a non-linear ad which does not require the playback of the main content to stop.

Link copied to clipboard

Contains the configuration options of a non-linear ad, i.e. an ad that does not interrupt the main content.

Link copied to clipboard

An ad which gets displayed during content playback.

Link copied to clipboard

Additional information on the seek operation.

Link copied to clipboard

Invoked when an attempt to play an AdItem ended, to decide whether the AdItem is discarded or kept for a later opportunity.

Link copied to clipboard

Can be implemented to receive a callback before an ad item is loaded.

Link copied to clipboard

Can be implemented to receive a callback every time an ad break is about to start.

Link copied to clipboard

Invoked after a forward seek or timeshift crosses one or more scheduled ad items.