MediaConstants

public final class MediaConstants


Media constants for sharing constants between media provider and consumer apps

Summary

Constants

static final String
BROWSER_ROOT_HINTS_KEY_CUSTOM_BROWSER_ACTION_LIMIT = "androidx.media.utils.MediaBrowserCompat.extras.CUSTOM_BROWSER_ACTION_LIMIT"

Bundle key used to define the total number of actions allowed per item.

static final String
BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELS = "android.media.extras.MEDIA_ART_SIZE_HINT_PIXELS"

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

static final String
BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_LIMIT = "androidx.media.MediaBrowserCompat.Extras.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 .

static final String
BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS = "androidx.media.MediaBrowserCompat.Extras.KEY_ROOT_CHILDREN_SUPPORTED_FLAGS"

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

static final String
BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT = "androidx.media.BrowserRoot.Extras.APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT"

Bundle key used to indicate that the MediaBrowserServiceCompat supports showing a settings page.

static final String
BROWSER_SERVICE_EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ROOT_LIST = "androidx.media.utils.extras.CUSTOM_BROWSER_ACTION_ROOT_LIST"

Bundle key used to store supported custom browser actions for media browsers that support custom browser actions.

static final String
BROWSER_SERVICE_EXTRAS_KEY_FAVORITES_MEDIA_ITEM = "androidx.media.BrowserRoot.Extras.FAVORITES_MEDIA_ITEM"

Bundle key used to pass a browseable android.media.browse.MediaBrowser.MediaItem that represents 'Favorite' content or some other notion of preset/pinned content.

static final String
BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED = "android.media.browse.SEARCH_SUPPORTED"

Bundle key sent through getExtras to the hosting to indicate that the MediaBrowserServiceCompat supports the method onSearch.

static final String
DESCRIPTION_EXTRAS_KEY_COMPLETION_PERCENTAGE = "androidx.media.MediaItem.Extras.COMPLETION_PERCENTAGE"

Bundle key sent through getExtras to the hosting to indicate an amount of completion progress for the corresponding MediaBrowserCompat.MediaItem.

static final String
DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS = "android.media.extra.PLAYBACK_STATUS"

Bundle key sent through getExtras to the hosting to indicate the playback completion status of the corresponding .

static final String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE = "android.media.browse.CONTENT_STYLE_BROWSABLE_HINT"

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

static final String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE = "android.media.browse.CONTENT_STYLE_GROUP_TITLE_HINT"

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

static final String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE = "android.media.browse.CONTENT_STYLE_PLAYABLE_HINT"

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

static final String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_SINGLE_ITEM = "android.media.browse.CONTENT_STYLE_SINGLE_ITEM_HINT"

Bundle key sent through getExtras to the hosting to indicate a preference about how the corresponding is presented.

static final String
DESCRIPTION_EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ID_LIST = "androidx.media.utils.extras.CUSTOM_BROWSER_ACTION_ID_LIST"

Bundle key used to define a string list of custom browser actions for a MediaBrowserCompat.MediaItem. e.g. "download","favorite","add to queue"

static final int

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

static final int

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

static final int

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

static final int

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

static final int

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

static final int

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

static final int

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

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_EXTRAS = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_EXTRAS"

Bundle key used to define an extras bundle for a custom browser action.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ICON_URI = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_ICON_URI"

Bundle key used to define the icon URI for a custom browser action.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ID = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_ID"

Bundle key used to define the ID for a custom browser action.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_LABEL = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_LABEL"

Bundle key used to define the label for a custom browser action.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_MEDIA_ITEM_ID = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_MEDIA_ITEM_ID"

Bundle key used to define the ID of the MediaBrowserCompat.MediaItem associated with the invoked action.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_BROWSE_NODE = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_BROWSE_NODE"

Bundle key set in MediaBrowserServiceCompat.Result to indicate which browse node should be displayed next.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_MESSAGE = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_MESSAGE"

Bundle key set in MediaBrowserServiceCompat.Result to set a message for the user.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_REFRESH_ITEM = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_REFRESH_ITEM"

Bundle key set in MediaBrowserServiceCompat.Result to refresh a MediaBrowserCompat.MediaItem in the browse tree.

static final String
EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_SHOW_PLAYING_ITEM = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_SHOW_PLAYING_ITEM"

Bundle key set in MediaBrowserServiceCompat.Result to show the currently playing item.

static final String
METADATA_KEY_CONTENT_ID = "androidx.media.MediaMetadatCompat.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).

static final String
METADATA_KEY_IS_ADVERTISEMENT = "android.media.metadata.ADVERTISEMENT"

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

static final String
METADATA_KEY_IS_EXPLICIT = "android.media.IS_EXPLICIT"

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

static final String
METADATA_KEY_NEXT_EPISODE_CONTENT_ID = "androidx.media.MediaMetadatCompat.METADATA_KEY_NEXT_EPISODE_CONTENT_ID"

Bundle key used for next episode's media content ID in metadata, following the same ID and format provided to Media Actions Catalog in reference to the next episode of the current title episode.

static final String
METADATA_KEY_SERIES_CONTENT_ID = "androidx.media.MediaMetadatCompat.METADATA_KEY_SERIES_CONTENT_ID"

Bundle key used for the TV series's media content ID in metadata, following the same ID and format provided to Media Actions Catalog in reference to the TV series of the current title episode.

static final long

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

static final String
PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT = "android.media.extras.ERROR_RESOLUTION_ACTION_INTENT"

Bundle key passed through getExtras to the hosting which maps to a pending intent.

static final String
PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL = "android.media.extras.ERROR_RESOLUTION_ACTION_LABEL"

Bundle key passed through getExtras to the hosting which maps to a label.

static final String
PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_USING_CAR_APP_LIBRARY_INTENT = "androidx.media.PlaybackStateCompat.Extras.ERROR_RESOLUTION_USING_CAR_APP_LIBRARY_INTENT"

Bundle key passed through getExtras to the which maps to a PendingIntent.

static final String
PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID = "androidx.media.PlaybackStateCompat.Extras.KEY_MEDIA_ID"

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

static final String
SESSION_EXTRAS_KEY_ACCOUNT_NAME = "androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_NAME"

Bundle key used for the account name in session extras.

static final String
SESSION_EXTRAS_KEY_ACCOUNT_TYPE = "androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_TYPE"

Bundle key used for the account type in session extras.

static final String
SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT = "android.media.playback.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_NEXT"

Bundle key passed from MediaSessionCompat to the hosting 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.

static final String
SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV = "android.media.playback.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_PREVIOUS"

Bundle key passed from MediaSessionCompat to the hosting 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.

static final String
TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE = "android.media.session.extra.LEGACY_STREAM_TYPE"

Bundle key passed through the extras of prepareFromMediaId, prepareFromSearch, prepareFromUri, playFromMediaId, playFromSearch, or playFromUri to indicate the stream type to be used by the session when playing or preparing the media.

static final String
TRANSPORT_CONTROLS_EXTRAS_KEY_SHUFFLE = "androidx.media.MediaControllerCompat.TransportControls.extras.KEY_SHUFFLE"

Bundle key passed through the extras of prepareFromMediaId, prepareFromSearch, prepareFromUri, playFromMediaId, playFromSearch, or playFromUri to indicate whether the session should shuffle the media to be played or not.

Constants

BROWSER_ROOT_HINTS_KEY_CUSTOM_BROWSER_ACTION_LIMIT

Added in 1.7.0
public static final String BROWSER_ROOT_HINTS_KEY_CUSTOM_BROWSER_ACTION_LIMIT = "androidx.media.utils.MediaBrowserCompat.extras.CUSTOM_BROWSER_ACTION_LIMIT"

Bundle key used to define the total number of actions allowed per item. Passed to MediaBrowserServiceCompat using onGetRoot in root hints bundle.

Presence of this key and positive value in the root hints indicates that custom browse actions feature is supported. Actions beyond this limit will be truncated.

TYPE: int, number of actions each item is limited to.

BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELS

Added in 1.3.0
public static final String BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELS = "android.media.extras.MEDIA_ART_SIZE_HINT_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.

BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_LIMIT

Added in 1.3.0
public static final String BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_LIMIT = "androidx.media.MediaBrowserCompat.Extras.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 . Excess root children may be omitted or made less discoverable by the host.

TYPE: int

BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS

Added in 1.3.0
public static final String BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS = "androidx.media.MediaBrowserCompat.Extras.KEY_ROOT_CHILDREN_SUPPORTED_FLAGS"

Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate which flags exposed by 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 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.

BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT

Added in 1.6.0
public static final String BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT = "androidx.media.BrowserRoot.Extras.APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT"

Bundle key used to indicate that the MediaBrowserServiceCompat supports showing a settings page.

Use this key to populate the Bundle that you pass to the constructor of the returned by onGetRoot. Use putParcelable to set a for this key. The PendingIntent is created using the getCarApp method.

The Intent carried by the pending intent needs to have the component name set to a Car App Library service that needs to exist in the same application package as the media browser service.

TYPE: PendingIntent.

BROWSER_SERVICE_EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ROOT_LIST

Added in 1.7.0
public static final String BROWSER_SERVICE_EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ROOT_LIST = "androidx.media.utils.extras.CUSTOM_BROWSER_ACTION_ROOT_LIST"

Bundle key used to store supported custom browser actions for media browsers that support custom browser actions.

The browser indicates support for custom browser actions by including the key BROWSER_ROOT_HINTS_KEY_CUSTOM_BROWSER_ACTION_LIMIT with a non-zero value in the root hints bundle passed to onGetRoot.

Use this key to add an ArrayList to the Bundle passed in MediaBrowserServiceCompat.BrowserRoot. MediaBrowserServiceCompat should add this bundle to the MediaBrowserServiceCompat.BrowserRoot when onGetRoot is called. Use putParcelableArrayList with a list of bundles, each defining a custom browser action, to set supported custom browser actions.

TYPE: arraylist, an ArrayList of Bundles, with each bundle defining a browse custom action.

A custom browser action is defined by an action ID, an action label, an action icon URI, and optionally an action extras bundle.

Custom browser action example:

BROWSER_SERVICE_EXTRAS_KEY_FAVORITES_MEDIA_ITEM

Added in 1.7.0
public static final String BROWSER_SERVICE_EXTRAS_KEY_FAVORITES_MEDIA_ITEM = "androidx.media.BrowserRoot.Extras.FAVORITES_MEDIA_ITEM"

Bundle key used to pass a browseable android.media.browse.MediaBrowser.MediaItem that represents 'Favorite' content or some other notion of preset/pinned content.

Use this key to indicate to consumers (e.g. Auto and Automotive) that they can display and/or subscribe to this item.

When this item is subscribed to, it is expected that the MediaBrowserService or MediaBrowserServiceCompat loads content that the user has marked for easy or quick access - e.g. favorite radio stations, pinned playlists, etc.

TYPE: MediaBrowser.MediaItem - note this should not be a MediaBrowserCompat.MediaItem

BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED

Added in 1.3.0
public static final String BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED = "android.media.browse.SEARCH_SUPPORTED"

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

TYPE: boolean

DESCRIPTION_EXTRAS_KEY_COMPLETION_PERCENTAGE

Added in 1.5.0
public static final String DESCRIPTION_EXTRAS_KEY_COMPLETION_PERCENTAGE = "androidx.media.MediaItem.Extras.COMPLETION_PERCENTAGE"

Bundle key sent through getExtras to the hosting to indicate an amount of completion progress for the corresponding MediaBrowserCompat.MediaItem. This extra augments the partially played status by indicating how much has been played by the user.

TYPE: double, a value between 0.0 and 1.0, inclusive. 0.0 indicates no completion progress (item is not started) and 1.0 indicates full completion progress (item is fully played). Values in between indicate partial progress (for example, 0.75 indicates the item is 75% complete).

See also
getExtras
setExtras

DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS

Added in 1.3.0
public static final String DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS = "android.media.extra.PLAYBACK_STATUS"

Bundle key sent through getExtras to the hosting to indicate the playback completion status of the corresponding .

TYPE: int. Possible values are separate constants.

DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE

Added in 1.3.0
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE = "android.media.browse.CONTENT_STYLE_BROWSABLE_HINT"

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

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

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

TYPE: int. Possible values are separate constants.

DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE

Added in 1.3.0
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE = "android.media.browse.CONTENT_STYLE_GROUP_TITLE_HINT"

Bundle key sent through getExtras to the hosting to indicate that certain instances of 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.

See also
getExtras
setExtras

DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE

Added in 1.3.0
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE = "android.media.browse.CONTENT_STYLE_PLAYABLE_HINT"

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

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

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

TYPE: int. Possible values are separate constants.

DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_SINGLE_ITEM

Added in 1.5.0
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_SINGLE_ITEM = "android.media.browse.CONTENT_STYLE_SINGLE_ITEM_HINT"

Bundle key sent through getExtras to the hosting to indicate a preference about how the corresponding is presented.

This preference takes precedence over those expressed by DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE and DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE.

TYPE: int. Possible values are separate constants.

DESCRIPTION_EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ID_LIST

Added in 1.7.0
public static final String DESCRIPTION_EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ID_LIST = "androidx.media.utils.extras.CUSTOM_BROWSER_ACTION_ID_LIST"

Bundle key used to define a string list of custom browser actions for a MediaBrowserCompat.MediaItem. e.g. "download","favorite","add to queue"

Supported media browsers use this Bundle key to build a list of custom browser actions for each MediaBrowserCompat.MediaItem.

This key is sent through getExtras to the MediaBrowserCompat to indicate supported custom browser actions for the corresponding MediaBrowserCompat.MediaItem.

Use a string array list with a list of custom browser action IDs. Set this bundle in the MediaBrowserCompat.MediaItem using setExtras to set the supported browse custom actions for the MediaBrowserCompat.MediaItem.

Each value action in this list must be an action ID defined in browser root with Bundle key BROWSER_SERVICE_EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ROOT_LIST.

TYPE: ArrayList, list of String custom browser action IDs.

DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED

Added in 1.3.0
public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED = 2

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

DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED

Added in 1.3.0
public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED = 0

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

DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED

Added in 1.3.0
public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED = 1

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

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM

Added in 1.3.0
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM = 4

Bundle value passed from the MediaBrowserServiceCompat to the hosting to indicate a preference that browsable instances of should be presented as "category" grid items. This means the items must provide tintable vector drawable icons that render well when they:

  • do not fill all of the available area
  • are tinted by the system to provide sufficient contrast against the background

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM

Added in 1.3.0
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM = 3

Bundle value passed from the MediaBrowserServiceCompat to the hosting to indicate a preference that browsable instances of should be presented as "category" list items. This means the items must provide tintable vector drawable icons that render well when they:

  • do not fill all of the available area
  • are tinted by the system to provide sufficient contrast against the background

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM

Added in 1.3.0
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM = 2

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

DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM

Added in 1.3.0
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM = 1

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

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_EXTRAS

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_EXTRAS = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_EXTRAS"

Bundle key used to define an extras bundle for a custom browser action.

Use putBundle on the custom browser action bundle to add this extras bundle to the custom browser action.

TYPE: Bundle.

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ICON_URI

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ICON_URI = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_ICON_URI"

Bundle key used to define the icon URI for a custom browser action.

TYPE: String, String content provider URI for a tintable vector drawable icon.

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ID

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_ID = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_ID"

Bundle key used to define the ID for a custom browser action.

TYPE: String, String ID for a custom browser action.

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_LABEL

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_LABEL = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_LABEL"

Bundle key used to define the label for a custom browser action. Label is a localized string that labels the action for the user.

TYPE: String, String label for a custom browser action. This must be localized.

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_MEDIA_ITEM_ID

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_MEDIA_ITEM_ID = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_MEDIA_ITEM_ID"

Bundle key used to define the ID of the MediaBrowserCompat.MediaItem associated with the invoked action.

A MediaBrowserCompat that supports custom browser actions can set this key in the parameter extra bundle when using sendCustomAction.

A MediaBrowserServiceCompat that supports custom browser actions should override onCustomAction to receive extras bundle set by media browsers.

TYPE: string, string ID of the MediaBrowserCompat.MediaItem on which the custom action was invoked.

See also
onCustomAction

MediaBrowserServiceCompat#onCustomAction(String, Bundle, MediaBrowserServiceCompat.Result)

sendCustomAction

MediaBrowserCompat#sendCustomAction(String, Bundle, MediaBrowserCompat.CustomActionCallback)

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_BROWSE_NODE

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_BROWSE_NODE = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_BROWSE_NODE"

Bundle key set in MediaBrowserServiceCompat.Result to indicate which browse node should be displayed next.

A MediaBrowserServiceCompat that supports custom browser actions can set this key in the MediaBrowserServiceCompat.Result passed in onCustomAction.

If this key is present in a MediaBrowserCompat.CustomActionCallback data Bundle the MediaBrowserCompat will update the current browse node when onResult is called by the MediaBrowserServiceCompat. The new browse node will be fetched by getItem.

A MediaBrowserServiceCompat that supports custom browser actions must implement onLoadItem to use this feature.

TYPE: string, string MediaBrowserCompat.MediaItem ID to set as new browse node.

See also
sendCustomAction

MediaBrowserCompat#sendCustomAction(String, Bundle, MediaBrowserCompat.CustomActionCallback)

MediaBrowserCompat.CustomActionCallback
onCustomAction

MediaBrowserServiceCompat#onCustomAction(String, Bundle, MediaBrowserServiceCompat.Result)

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_MESSAGE

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_MESSAGE = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_MESSAGE"

Bundle key set in MediaBrowserServiceCompat.Result to set a message for the user.

A MediaBrowserServiceCompat that supports custom browser actions can set this key in the MediaBrowserServiceCompat.Result passed in onCustomAction.

If this key is present in MediaBrowserCompat.CustomActionCallbackMediaBrowserServiceCompat.Result, the message will be shown to the user when onProgressUpdate or onResult is called by the MediaBrowserServiceCompat.

TYPE: string, localized message string to show the user.

See also
sendCustomAction

MediaBrowserCompat#sendCustomAction(String, Bundle, MediaBrowserCompat.CustomActionCallback)

MediaBrowserCompat.CustomActionCallback
onCustomAction

MediaBrowserServiceCompat#onCustomAction(String, Bundle, MediaBrowserServiceCompat.Result)

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_REFRESH_ITEM

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_REFRESH_ITEM = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_REFRESH_ITEM"

Bundle key set in MediaBrowserServiceCompat.Result to refresh a MediaBrowserCompat.MediaItem in the browse tree.

A MediaBrowserServiceCompat that supports custom browser actions can set this key in the MediaBrowserServiceCompat.Result passed in onCustomAction.

If this key is present in MediaBrowserCompat.CustomActionCallbackMediaBrowserServiceCompat.Result, the item will be refreshed with getItem when onProgressUpdate or onResult is called by the MediaBrowserServiceCompat.

A MediaBrowserServiceCompat that supports custom browser actions must implement onLoadItem in order to update the state of the item.

TYPE: string, string MediaBrowserCompat.MediaItem ID to refresh.

See also
sendCustomAction

MediaBrowserCompat#sendCustomAction(String, Bundle, MediaBrowserCompat.CustomActionCallback)

MediaBrowserCompat.CustomActionCallback
onCustomAction

MediaBrowserServiceCompat#onCustomAction(String, Bundle, MediaBrowserServiceCompat.Result)

EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_SHOW_PLAYING_ITEM

Added in 1.7.0
public static final String EXTRAS_KEY_CUSTOM_BROWSER_ACTION_RESULT_SHOW_PLAYING_ITEM = "androidx.media.utils.extras.KEY_CUSTOM_BROWSER_ACTION_RESULT_SHOW_PLAYING_ITEM"

Bundle key set in MediaBrowserServiceCompat.Result to show the currently playing item.

A MediaBrowserServiceCompat that supports custom browser actions can set this key in the MediaBrowserServiceCompat.Result passed in onCustomAction.

If this key is present and the value is true in MediaBrowserCompat.CustomActionCallbackMediaBrowserServiceCompat.Result, the currently playing item will be shown when onResult is called by the MediaBrowserServiceCompat.

TYPE: boolean, boolean value of true will show currently playing item.

See also
sendCustomAction

MediaBrowserCompat#sendCustomAction(String, Bundle, MediaBrowserCompat.CustomActionCallback)

MediaBrowserCompat.CustomActionCallback
onCustomAction

MediaBrowserServiceCompat#onCustomAction(String, Bundle, MediaBrowserServiceCompat.Result)

METADATA_KEY_CONTENT_ID

Added in 1.2.0
public static final String METADATA_KEY_CONTENT_ID = "androidx.media.MediaMetadatCompat.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). This key can contain the content ID of the currently playing episode or movie and can be used to help users continue watching after this session is paused or stopped.

TYPE: String

METADATA_KEY_IS_ADVERTISEMENT

Added in 1.3.0
public static final String METADATA_KEY_IS_ADVERTISEMENT = "android.media.metadata.ADVERTISEMENT"

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

TYPE: long (to enable, use value METADATA_VALUE_ATTRIBUTE_PRESENT)

METADATA_KEY_IS_EXPLICIT

Added in 1.3.0
public static final String METADATA_KEY_IS_EXPLICIT = "android.media.IS_EXPLICIT"

Key sent through a key-value mapping in getLong or in the getExtras bundle to the hosting MediaBrowserCompat to indicate that the corresponding MediaMetadataCompat or 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)

METADATA_KEY_NEXT_EPISODE_CONTENT_ID

Added in 1.4.0
public static final String METADATA_KEY_NEXT_EPISODE_CONTENT_ID = "androidx.media.MediaMetadatCompat.METADATA_KEY_NEXT_EPISODE_CONTENT_ID"

Bundle key used for next episode's media content ID in metadata, following the same ID and format provided to Media Actions Catalog in reference to the next episode of the current title episode. This key can contain the content ID of the episode immediately following the currently playing episode and can be used to help users continue watching after this episode is over. This value is only valid for TV Episode content type and should be left blank for other content.

TYPE: String

METADATA_KEY_SERIES_CONTENT_ID

Added in 1.4.0
public static final String METADATA_KEY_SERIES_CONTENT_ID = "androidx.media.MediaMetadatCompat.METADATA_KEY_SERIES_CONTENT_ID"

Bundle key used for the TV series's media content ID in metadata, following the same ID and format provided to Media Actions Catalog in reference to the TV series of the current title episode. This value is only valid for TV Episode content type and should be left blank for other content.

TYPE: String

METADATA_VALUE_ATTRIBUTE_PRESENT

Added in 1.3.0
public static final long METADATA_VALUE_ATTRIBUTE_PRESENT = 1

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

See also
getLong
putLong

PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT

Added in 1.3.0
public static final String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT = "android.media.extras.ERROR_RESOLUTION_ACTION_INTENT"

Bundle key passed through getExtras to the hosting 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. The key BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT should be used instead if the intent points to a Car App Library service. The intent is NOT auto launched and the user first sees an actionable button with label set to PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL. Clicking that button launches the intent.

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

PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL

Added in 1.3.0
public static final String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL = "android.media.extras.ERROR_RESOLUTION_ACTION_LABEL"

Bundle key passed through getExtras to the hosting 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 getErrorMessage.

TYPE: String. Should be human readable and localized.

PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_USING_CAR_APP_LIBRARY_INTENT

Added in 1.6.0
public static final String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_USING_CAR_APP_LIBRARY_INTENT = "androidx.media.PlaybackStateCompat.Extras.ERROR_RESOLUTION_USING_CAR_APP_LIBRARY_INTENT"

Bundle key passed through getExtras to the which maps to a PendingIntent. When launched, the PendingIntent should allow users to resolve the current playback state error. The intent should have the component name set to a Car App Library service which exists in the same application package as the media browser service. The intent may be launched directly unlike the behavior when using PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT. Applications must also set the error message and PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL for cases in which the intent cannot be auto launched.

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

See also
getExtras
setExtras

PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID

Added in 1.2.0
public static final String PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID = "androidx.media.PlaybackStateCompat.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

See also
getExtras
setExtras

SESSION_EXTRAS_KEY_ACCOUNT_NAME

Added in 1.2.0
public static final String SESSION_EXTRAS_KEY_ACCOUNT_NAME = "androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_NAME"

Bundle key used for the account name in session extras.

TYPE: String

See also
getExtras
setExtras

SESSION_EXTRAS_KEY_ACCOUNT_TYPE

Added in 1.2.0
public static final String SESSION_EXTRAS_KEY_ACCOUNT_TYPE = "androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_TYPE"

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

TYPE: String

See also
getExtras
setExtras

SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT

Added in 1.3.0
public static final String SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT = "android.media.playback.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_NEXT"

Bundle key passed from MediaSessionCompat to the hosting 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

See also
getExtras
setExtras

SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV

Added in 1.3.0
public static final String SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV = "android.media.playback.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_PREVIOUS"

Bundle key passed from MediaSessionCompat to the hosting 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

See also
getExtras
setExtras

TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE

Added in 1.4.0
public static final String TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE = "android.media.session.extra.LEGACY_STREAM_TYPE"

Bundle key passed through the extras of prepareFromMediaId, prepareFromSearch, prepareFromUri, playFromMediaId, playFromSearch, or playFromUri to indicate the stream type to be used by the session when playing or preparing the media.

TYPE: int

TRANSPORT_CONTROLS_EXTRAS_KEY_SHUFFLE

Added in 1.4.0
public static final String TRANSPORT_CONTROLS_EXTRAS_KEY_SHUFFLE = "androidx.media.MediaControllerCompat.TransportControls.extras.KEY_SHUFFLE"

Bundle key passed through the extras of prepareFromMediaId, prepareFromSearch, prepareFromUri, playFromMediaId, playFromSearch, or playFromUri to indicate whether the session should shuffle the media to be played or not. The extra parameter is limited to the current request and doesn't affect the shuffle mode.

TYPE: boolean