Google is committed to advancing racial equity for Black communities. See how.

MediaConstants

public final class MediaConstants
extends Object

java.lang.Object
   ↳ androidx.media.utils.MediaConstants


Media constants for sharing constants between media provider and consumer apps

Summary

Constants

String METADATA_KEY_CONTENT_ID

Bundle key used for media content id in metadata, should contain the same ID provided to Media Actions Catalog in reference to this title (e.g., episode, movie).

String PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID

Bundle key used for the media id in playback state extras.

String SESSION_EXTRAS_KEY_ACCOUNT_NAME

Bundle key used for the account name in session extras.

String SESSION_EXTRAS_KEY_ACCOUNT_TYPE

Bundle key used for the account type in session extras.

Inherited methods

Constants

METADATA_KEY_CONTENT_ID

public static final String METADATA_KEY_CONTENT_ID

Bundle key used for media content id in metadata, should contain the same ID provided to Media Actions Catalog in reference to this title (e.g., episode, movie). Google uses this information to allow users to resume watching this title on your app across the supported surfaces (e.g., Android TV's Play Next row)

TYPE: String

Constant Value: "androidx.media.MediaMetadatCompat.METADATA_KEY_CONTENT_ID"

PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID

public static final String PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID

Bundle key used for the media id in playback state extras. It's for associating the playback state with the media being played so the value is expected to be same with media id of the current metadata.

TYPE: String

Constant Value: "androidx.media.PlaybackStateCompat.Extras.KEY_MEDIA_ID"

SESSION_EXTRAS_KEY_ACCOUNT_NAME

public static final String SESSION_EXTRAS_KEY_ACCOUNT_NAME

Bundle key used for the account name in session extras.

TYPE: String

Constant Value: "androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_NAME"

SESSION_EXTRAS_KEY_ACCOUNT_TYPE

public static final String SESSION_EXTRAS_KEY_ACCOUNT_TYPE

Bundle key used for the account type in session extras. The value would vary across media applications.

TYPE: String

Constant Value: "androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_TYPE"