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 BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELS

Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate the recommended size, in pixels, for media art bitmaps.

String BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_LIMIT

Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate the maximum number of children of the root node that can be supported by the hosting MediaBrowserCompat.

String BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS

Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate which flags exposed by MediaBrowserCompat.MediaItem.getFlags() from children of the root node are supported by the hosting MediaBrowserCompat.

String BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED

Bundle key sent through MediaBrowserCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the MediaBrowserServiceCompat supports the method MediaBrowserServiceCompat.onSearch(String, Bundle, MediaBrowserServiceCompat.Result).

String DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS

Bundle key sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate the playback completion status of the corresponding MediaBrowserCompat.MediaItem.

String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE

Bundle key passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference about how browsable instances of MediaBrowserCompat.MediaItem are presented.

String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE

Bundle key sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that certain instances of MediaBrowserCompat.MediaItem are related as a group, with a title that is specified through the bundle value.

String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE

Bundle key passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference about how playable instances of MediaBrowserCompat.MediaItem are presented.

int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED

Bundle value sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the corresponding MediaBrowserCompat.MediaItem has been fully played by the user.

int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED

Bundle value sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the corresponding MediaBrowserCompat.MediaItem has not been played by the user.

int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED

Bundle value sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the corresponding MediaBrowserCompat.MediaItem has been partially played by the user.

int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that browsable instances of MediaBrowserCompat.MediaItem should be presented as "category" grid items.

int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that browsable instances of MediaBrowserCompat.MediaItem should be presented as "category" list items.

int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that certain instances of MediaBrowserCompat.MediaItem should be presented as grid items.

int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that certain instances of MediaBrowserCompat.MediaItem should be presented as list items.

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 METADATA_KEY_IS_ADVERTISEMENT

Key sent through a key-value mapping in MediaMetadataCompat.getLong(String) or in the MediaDescriptionCompat.getExtras() bundle to the hosting MediaBrowserCompat to indicate that the corresponding MediaMetadataCompat or MediaBrowserCompat.MediaItem is an advertisement.

String METADATA_KEY_IS_EXPLICIT

Key sent through a key-value mapping in MediaMetadataCompat.getLong(String) or in the MediaDescriptionCompat.getExtras() bundle to the hosting MediaBrowserCompat to indicate that the corresponding MediaMetadataCompat or MediaBrowserCompat.MediaItem has explicit content (i.e.

long METADATA_VALUE_ATTRIBUTE_PRESENT

Value sent through a key-value mapping of MediaMetadataCompat, or through Bundle extras on a different data type, to indicate the presence of an attribute described by its corresponding key.

String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT

Bundle key passed through PlaybackStateCompat.getExtras() to the hosting MediaControllerCompat which maps to a pending intent.

String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL

Bundle key passed through PlaybackStateCompat.getExtras() to the hosting MediaControllerCompat which maps to a label.

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.

String SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT

Bundle key passed from MediaSessionCompat to the hosting MediaControllerCompat to indicate a preference that a region of space for the skip to next control should always be blocked out in the UI, even when the skip to next standard action is not supported.

String SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV

Bundle key passed from MediaSessionCompat to the hosting MediaControllerCompat to indicate a preference that a region of space for the skip to previous control should always be blocked out in the UI, even when the skip to previous standard action is not supported.

Inherited methods

Constants

BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELS

public static final String BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELS

Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate the recommended size, in pixels, for media art bitmaps. Much smaller images may not render well, and much larger images may cause inefficient resource consumption.

Constant Value: "android.media.extras.MEDIA_ART_SIZE_HINT_PIXELS"

BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_LIMIT

public static final String BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_LIMIT

Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate the maximum number of children of the root node that can be supported by the hosting MediaBrowserCompat. Excess root children may be omitted or made less discoverable by the host.

TYPE: int

Constant Value: "androidx.media.MediaBrowserCompat.Extras.KEY_ROOT_CHILDREN_LIMIT"

BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS

public static final String BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS

Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate which flags exposed by MediaBrowserCompat.MediaItem.getFlags() from children of the root node are supported by the hosting MediaBrowserCompat. Root children with unsupported flags may be omitted or made less discoverable by the host.

TYPE: int, a bit field which can be used as a mask. For example, if the value masked (using bitwise AND) with MediaBrowserCompat.MediaItem.FLAG_BROWSABLE is nonzero, then the host supports browsable root children. Conversely, if the masked result is zero, then the host does not support them.

Constant Value: "androidx.media.MediaBrowserCompat.Extras.KEY_ROOT_CHILDREN_SUPPORTED_FLAGS"

BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED

public static final String BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED

Bundle key sent through MediaBrowserCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the MediaBrowserServiceCompat supports the method MediaBrowserServiceCompat.onSearch(String, Bundle, MediaBrowserServiceCompat.Result). If sent as true, the host may expose affordances which call the search method.

TYPE: boolean

Constant Value: "android.media.browse.SEARCH_SUPPORTED"

DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS

public static final String DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS

Bundle key sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate the playback completion status of the corresponding MediaBrowserCompat.MediaItem.

TYPE: int. Possible values are separate constants.

Constant Value: "android.media.extra.PLAYBACK_STATUS"

DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE

public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE

Bundle key passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference about how browsable instances of MediaBrowserCompat.MediaItem are presented.

If exposed through MediaBrowserCompat.getExtras(), the preference applies to all browsable items within the browse tree.

If exposed through MediaDescriptionCompat.getExtras(), the preference applies to only the immediate browsable children of the corresponding browsable item. It takes precedence over preferences sent through MediaBrowserCompat.getExtras().

TYPE: int. Possible values are separate constants.

Constant Value: "android.media.browse.CONTENT_STYLE_BROWSABLE_HINT"

DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE

public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE

Bundle key sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that certain instances of MediaBrowserCompat.MediaItem are related as a group, with a title that is specified through the bundle value. Items that are children of the same browsable node and have the same title are members of the same group. The host may present a group's items as a contiguous block and display the title alongside the group.

TYPE: String. Should be human readable and localized.

Constant Value: "android.media.browse.CONTENT_STYLE_GROUP_TITLE_HINT"

DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE

public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE

Bundle key passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference about how playable instances of MediaBrowserCompat.MediaItem are presented.

If exposed through MediaBrowserCompat.getExtras(), the preference applies to all playable items within the browse tree.

If exposed through MediaDescriptionCompat.getExtras(), the preference applies to only the immediate playable children of the corresponding browsable item. It takes precedence over preferences sent through MediaBrowserCompat.getExtras().

TYPE: int. Possible values are separate constants.

Constant Value: "android.media.browse.CONTENT_STYLE_PLAYABLE_HINT"

DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED

public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED

Bundle value sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the corresponding MediaBrowserCompat.MediaItem has been fully played by the user.

Constant Value: 2 (0x00000002)

DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED

public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED

Bundle value sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the corresponding MediaBrowserCompat.MediaItem has not been played by the user.

Constant Value: 0 (0x00000000)

DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED

public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED

Bundle value sent through MediaDescriptionCompat.getExtras() to the hosting MediaBrowserCompat to indicate that the corresponding MediaBrowserCompat.MediaItem has been partially played by the user.

Constant Value: 1 (0x00000001)

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM

public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that browsable instances of MediaBrowserCompat.MediaItem should be presented as "category" grid items. This means the items provide icons that render well when they do not fill all of the available area.

Constant Value: 4 (0x00000004)

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM

public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that browsable instances of MediaBrowserCompat.MediaItem should be presented as "category" list items. This means the items provide icons that render well when they do not fill all of the available area.

Constant Value: 3 (0x00000003)

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM

public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that certain instances of MediaBrowserCompat.MediaItem should be presented as grid items.

Constant Value: 2 (0x00000002)

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM

public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM

Bundle value passed from the MediaBrowserServiceCompat to the hosting MediaBrowserCompat to indicate a preference that certain instances of MediaBrowserCompat.MediaItem should be presented as list items.

Constant Value: 1 (0x00000001)

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"

METADATA_KEY_IS_ADVERTISEMENT

public static final String METADATA_KEY_IS_ADVERTISEMENT

Key sent through a key-value mapping in MediaMetadataCompat.getLong(String) or in the MediaDescriptionCompat.getExtras() bundle to the hosting MediaBrowserCompat to indicate that the corresponding MediaMetadataCompat or MediaBrowserCompat.MediaItem is an advertisement.

TYPE: long (to enable, use value METADATA_VALUE_ATTRIBUTE_PRESENT)

Constant Value: "android.media.metadata.ADVERTISEMENT"

METADATA_KEY_IS_EXPLICIT

public static final String METADATA_KEY_IS_EXPLICIT

Key sent through a key-value mapping in MediaMetadataCompat.getLong(String) or in the MediaDescriptionCompat.getExtras() bundle to the hosting MediaBrowserCompat to indicate that the corresponding MediaMetadataCompat or MediaBrowserCompat.MediaItem has explicit content (i.e. user discretion is advised when viewing or listening to this content).

TYPE: long (to enable, use value METADATA_VALUE_ATTRIBUTE_PRESENT)

Constant Value: "android.media.IS_EXPLICIT"

METADATA_VALUE_ATTRIBUTE_PRESENT

public static final long METADATA_VALUE_ATTRIBUTE_PRESENT

Value sent through a key-value mapping of MediaMetadataCompat, or through Bundle extras on a different data type, to indicate the presence of an attribute described by its corresponding key.

Constant Value: 1 (0x0000000000000001)

PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT

public static final String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT

Bundle key passed through PlaybackStateCompat.getExtras() to the hosting MediaControllerCompat which maps to a pending intent. When launched, the intent should allow users to resolve the current playback state error. A label should be included in the same Bundle.

TYPE: PendingIntent. Should be inserted into the Bundle as a Parcelable.

Constant Value: "android.media.extras.ERROR_RESOLUTION_ACTION_INTENT"

PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL

public static final String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL

Bundle key passed through PlaybackStateCompat.getExtras() to the hosting MediaControllerCompat which maps to a label. The label is associated with the action that allow users to resolve the current playback state error.

The label should be short; a more detailed explanation can be provided to the user via PlaybackStateCompat.getErrorMessage().

TYPE: String. Should be human readable and localized.

Constant Value: "android.media.extras.ERROR_RESOLUTION_ACTION_LABEL"

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"

SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT

public static final String SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT

Bundle key passed from MediaSessionCompat to the hosting MediaControllerCompat to indicate a preference that a region of space for the skip to next control should always be blocked out in the UI, even when the skip to next standard action is not supported. This may be used when the session temporarily hides skip to next by design.

TYPE: boolean

Constant Value: "android.media.playback.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_NEXT"

SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV

public static final String SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV

Bundle key passed from MediaSessionCompat to the hosting MediaControllerCompat to indicate a preference that a region of space for the skip to previous control should always be blocked out in the UI, even when the skip to previous standard action is not supported. This may be used when the session temporarily hides skip to previous by design.

TYPE: boolean

Constant Value: "android.media.playback.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_PREVIOUS"