MediaItem.RequestMetadata


public final class MediaItem.RequestMetadata implements Bundleable


Metadata that helps the player to understand a playback request represented by a .

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

Builder for RequestMetadata instances.

Constants

static final Bundleable.Creator<MediaItem.RequestMetadata>

This field is deprecated.

Use fromBundle instead.

static final MediaItem.RequestMetadata

Empty request metadata.

Public fields

final @Nullable Bundle

Optional extras Bundle.

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 Builder initialized with the values of this instance.

boolean
static MediaItem.RequestMetadata

Restores a RequestMetadata from a Bundle.

int
Bundle

Returns a Bundle representing the information stored in this object.

Constants

CREATOR

@UnstableApi
public static final Bundleable.Creator<MediaItem.RequestMetadataCREATOR

An object that can restore RequestMetadata from a Bundle.

EMPTY

public static final MediaItem.RequestMetadata EMPTY

Empty request metadata.

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.

equals

public boolean equals(@Nullable Object o)

fromBundle

@UnstableApi
public static MediaItem.RequestMetadata fromBundle(Bundle bundle)

Restores a RequestMetadata from a Bundle.

hashCode

public int hashCode()

toBundle

@UnstableApi
public Bundle toBundle()

Returns a Bundle representing the information stored in this object.