Package com.google.android.exoplayer2
Class MediaItem.RequestMetadata
- java.lang.Object
-
- com.google.android.exoplayer2.MediaItem.RequestMetadata
-
- All Implemented Interfaces:
Bundleable
- Enclosing class:
- MediaItem
public static final class MediaItem.RequestMetadata extends Object implements Bundleable
Metadata that helps the player to understand a playback request represented by aMediaItem
.This metadata is most useful for cases where playback requests are forwarded to other player instances (e.g. from a
androidx.media3.session.MediaController
) and the player creating the request doesn't know the requiredMediaItem.LocalConfiguration
for playback.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MediaItem.RequestMetadata.Builder
Builder forMediaItem.RequestMetadata
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 static Bundleable.Creator<MediaItem.RequestMetadata>
CREATOR
An object that can restoreMediaItem.RequestMetadata
from aBundle
.static MediaItem.RequestMetadata
EMPTY
Empty request metadata.Bundle
extras
Optional extrasBundle
.Uri
mediaUri
The URI of the requested media, or null if not known or applicable.String
searchQuery
The search query for the requested media, or null if not applicable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaItem.RequestMetadata.Builder
buildUpon()
Returns aMediaItem.RequestMetadata.Builder
initialized with the values of this instance.boolean
equals(Object o)
int
hashCode()
Bundle
toBundle()
Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
EMPTY
public static final MediaItem.RequestMetadata EMPTY
Empty request metadata.
-
mediaUri
@Nullable public final Uri mediaUri
The URI of the requested media, or null if not known or applicable.
-
searchQuery
@Nullable public final String searchQuery
The search query for the requested media, or null if not applicable.
-
extras
@Nullable public final Bundle extras
Optional extrasBundle
.Given the complexities of checking the equality of two
Bundle
s, this is not considered in theequals(Object)
orhashCode()
.
-
CREATOR
public static final Bundleable.Creator<MediaItem.RequestMetadata> CREATOR
An object that can restoreMediaItem.RequestMetadata
from aBundle
.
-
-
Method Detail
-
buildUpon
public MediaItem.RequestMetadata.Builder buildUpon()
Returns aMediaItem.RequestMetadata.Builder
initialized with the values of this instance.
-
toBundle
public Bundle toBundle()
Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-