AdItem
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) : Parcelable
Represents an ad break which can be scheduled for playback.
One single AdItem can have multiple AdSources where all but the first act as fallback ad sources if the first one fails to load. The start and end of an ad break are signaled via PlayerEvent.AdBreakStarted and PlayerEvent.AdBreakFinished.
If the ad view group is removed or set the first time (e.g. by passing null to Player.ads.setAdViewGroup or by moving the hosting app to the background) after an IMA AdSource has been loaded, the according AdItem is discarded. The same holds true if the ad view group is removed or set during ad playback. This doesn't affect progressive AdSources.
Constructors
| AdItem | constructor(sources: Array<AdSource>, position: String = DEFAULT_POSITION, replaceContentDuration: Double = DEFAULT_REPLACE_CONTENT_DURATION, preloadOffset: Double = DEFAULT_PRELOAD_OFFSET, bitmovinAdTagLoading: Boolean = false)constructor(vararg sources: AdSource)constructor(position: String, vararg sources: AdSource)constructor(position: String, replaceContentDuration: Double, vararg sources: AdSource) |
Properties
| Name | Summary |
|---|---|
| bitmovinAdTagLoading | val bitmovinAdTagLoading: Boolean When enabled, the player itself downloads the initial ad tag. For ads with AdSourceType.Ima, this means that the provided ad tag is not fetched by IMA. If the downloaded ad tag is a VMAP, the VMAP structure is processed by Bitmovin Advertising and any resulting VAST responses and wrapper are handled according to the configured AdSourceType. This property only has effect on ads with AdSourceType.Ima. |
| position | val position: String The playback position at which the ad break is scheduled to start. Default value is "pre". |
| preloadOffset | val preloadOffset: Double The amount of seconds before the scheduled ad break when ad loading is started. |
| replaceContentDuration | val replaceContentDuration: Double The amount of seconds of the main video content that should be replaced by this ad break. |
| sources | val sources: Array<AdSource> The AdSources that make up this AdItem. The first ad source in this array is used as the main ad. Subsequent ad sources act as a fallback, meaning that if the main ad source does not provide a valid response, the subsequent ad sources will be utilized one after another. |