docs/doc/reference/com/google/android/exoplayer2/MediaItem.AdsConfiguration.html
Package com.google.android.exoplayer2
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 Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | MediaItem.AdsConfiguration.Builder |
Builder for MediaItem.AdsConfiguration instances.
|
-
Bundleable.Creator<T extends Bundleable>
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.
|
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.
|
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
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.
-
@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.
-
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.
-
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.
-
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
-
public int hashCode()
Overrides:hashCode in class Object
-
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