MediaItem.RequestMetadata
public final class MediaItem.RequestMetadata
Metadata that helps the player to understand a playback request represented by a MediaItem.
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 required LocalConfiguration for playback.
Summary
Nested types |
|---|
public final class MediaItem.RequestMetadata.BuilderBuilder for |
Constants |
|
|---|---|
static final MediaItem.RequestMetadata |
Empty request metadata. |
Public fields |
|
|---|---|
final @Nullable Bundle |
Optional extras |
final @Nullable Uri |
The URI of the requested media, or null if not known or applicable. |
final @Nullable String |
The search query for the requested media, or null if not applicable. |
Public methods |
|
|---|---|
MediaItem.RequestMetadata.Builder |
Returns a |
boolean |
|
static MediaItem.RequestMetadata |
@UnstableApiRestores a |
int |
hashCode() |
Bundle |
Constants
Public fields
extras
public final @Nullable Bundle extras
Optional extras Bundle.
Given the complexities of checking the equality of two Bundle instances, the contents of these extras are not considered in the equals or hashCode implementation.
mediaUri
public final @Nullable Uri mediaUri
The URI of the requested media, or null if not known or applicable.
searchQuery
public final @Nullable String searchQuery
The search query for the requested media, or null if not applicable.
Public methods
buildUpon
public MediaItem.RequestMetadata.Builder buildUpon()
Returns a Builder initialized with the values of this instance.
fromBundle
@UnstableApi
public static MediaItem.RequestMetadata fromBundle(Bundle bundle)
Restores a RequestMetadata from a Bundle.