Back to Exoplayer

MediaItem.AdsConfiguration (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/MediaItem.AdsConfiguration.html

latest5.4 KB
Original Source

Package com.google.android.exoplayer2

Class MediaItem.AdsConfiguration

  • java.lang.Object

    • com.google.android.exoplayer2.MediaItem.AdsConfiguration
  • All Implemented Interfaces:BundleableEnclosing class:MediaItem


public static final classMediaItem.AdsConfigurationextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Bundleable](Bundleable.html "interface in com.google.android.exoplayer2")

Configuration for playing back linear ads with a media item.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | MediaItem.AdsConfiguration.Builder | Builder for MediaItem.AdsConfiguration instances. |

- 

Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable

Bundleable.Creator<T extends Bundleable>

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | 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. | | Uri | adTagUri | The ad tag URI to load. | | static Bundleable.Creator<MediaItem.AdsConfiguration> | CREATOR | An object that can restore MediaItem.AdsConfiguration from a Bundle. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | MediaItem.AdsConfiguration.Builder | buildUpon() | Returns a MediaItem.AdsConfiguration.Builder initialized with the values of this instance. | | boolean | equals​(Object obj) | | | int | hashCode() | | | Bundle | toBundle() | Returns a Bundle representing the information stored in this object. |

- 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

adTagUri

public final[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")adTagUri

The ad tag URI to load.

- 

adsId

@Nullable
public final[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")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.

- 

CREATOR

public static final[Bundleable.Creator](Bundleable.Creator.html "interface in com.google.android.exoplayer2")<[MediaItem.AdsConfiguration](MediaItem.AdsConfiguration.html "class in com.google.android.exoplayer2")> CREATOR

An object that can restore MediaItem.AdsConfiguration from a Bundle.

The adsId of a restored instance will always be null.

Method Detail

- 

buildUpon

public[MediaItem.AdsConfiguration.Builder](MediaItem.AdsConfiguration.Builder.html "class in com.google.android.exoplayer2")buildUpon()

Returns a MediaItem.AdsConfiguration.Builder initialized with the values of this instance.

- 

equals

public boolean equals​(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")obj)

Overrides:equals in class Object

- 

hashCode

public int hashCode()

Overrides:hashCode in class Object

- 

toBundle

public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle()

Returns a Bundle 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.

Specified by:toBundle in interface Bundleable