public final class

MediaItem.AdsConfiguration

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.MediaItem.AdsConfiguration

Overview

Configuration for playing back linear ads with a media item.

Summary

Fields
public final java.lang.ObjectadsId

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 final UriadTagUri

The ad tag URI to load.

Methods
public MediaItem.AdsConfiguration.BuilderbuildUpon()

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

public booleanequals(java.lang.Object obj)

public static MediaItem.AdsConfigurationfromBundle(Bundle bundle)

Restores a AdsConfiguration from a .

public inthashCode()

public BundletoBundle()

Returns a representing the information stored in this object.

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public final Uri adTagUri

The ad tag URI to load.

public final java.lang.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.

Methods

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

public boolean equals(java.lang.Object obj)

public int hashCode()

public static MediaItem.AdsConfiguration fromBundle(Bundle bundle)

Restores a AdsConfiguration from a .

public Bundle toBundle()

Returns a representing the information stored in this object.

It omits the MediaItem.AdsConfiguration.adsId field. The MediaItem.AdsConfiguration.adsId of an instance restored from such a bundle by MediaItem.AdsConfiguration.fromBundle(Bundle) will be null.