MediaItem.AdsConfiguration


public final class MediaItem.AdsConfiguration implements Bundleable


Configuration for playing back linear ads with a media item.

Summary

Nested types

Builder for AdsConfiguration instances.

Constants

static final Bundleable.Creator<MediaItem.AdsConfiguration>

This field is deprecated.

Use fromBundle instead.

Public fields

final Uri

The ad tag URI to load.

final @Nullable Object

An opaque identifier for ad playback state associated with this item, or null if the combination of the media ID and ad tag URI should be used as the ads identifier.

Public methods

MediaItem.AdsConfiguration.Builder

Returns a Builder initialized with the values of this instance.

boolean
static MediaItem.AdsConfiguration

Restores a AdsConfiguration from a Bundle.

int
Bundle

Returns a representing the information stored in this object.

Constants

CREATOR

@UnstableApi
public static final Bundleable.Creator<MediaItem.AdsConfigurationCREATOR

An object that can restore AdsConfiguration from a Bundle.

The adsId of a restored instance will always be null.

Public fields

adTagUri

public final Uri adTagUri

The ad tag URI to load.

adsId

public final @Nullable Object adsId

An opaque identifier for ad playback state associated with this item, or null if the combination of the media ID and ad tag URI should be used as the ads identifier.

Media items in the playlist that have the same ads identifier and ads loader share the same ad playback state. To resume ad playback when recreating the playlist on returning from the background, pass the same ads identifiers to the player.

Public methods

buildUpon

public MediaItem.AdsConfiguration.Builder buildUpon()

Returns a Builder initialized with the values of this instance.

equals

public boolean equals(@Nullable Object obj)

fromBundle

@UnstableApi
public static MediaItem.AdsConfiguration fromBundle(Bundle bundle)

Restores a AdsConfiguration from a Bundle.

hashCode

public int hashCode()

toBundle

@UnstableApi
public Bundle toBundle()

Returns a representing the information stored in this object.

It omits the adsId field. The adsId of an instance restored from such a bundle by CREATOR will be null.