MediaIntentExtras


public class MediaIntentExtras


Defines constants for action and extra keys for CarMediaApp.

Summary

Constants

static final String
ACTION_MEDIA_TEMPLATE_V2 = "androidx.car.app.mediaextensions.action.MEDIA_TEMPLATE_V2"

Activity Action: Provide media playing through a media template app.

static final String
EXTRA_KEY_MEDIA_COMPONENT = "android.car.intent.extra.MEDIA_COMPONENT"

Bundle key used as a string extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the MediaBrowserService that user wants to start the media on.

static final String
EXTRA_KEY_MEDIA_ID = "androidx.car.app.mediaextensions.extra.KEY_MEDIA_ID"

Bundle key used as a string extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the media item that should be displayed in the browse view.

static final String
EXTRA_KEY_SEARCH_ACTION = "androidx.car.app.mediaextensions.extra.KEY_SEARCH_ACTION"

Bundle key used as an int extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the action for the Media Center to do after the search query is loaded.

static final String
EXTRA_KEY_SEARCH_QUERY = "android.car.media.extra.SEARCH_QUERY"

Bundle key used as a string extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the search query to send either to the current MediaBrowserService or the one specified with EXTRA_KEY_MEDIA_COMPONENT.

static final int

The extra value to indicate that no further action will be taken after the search results are loaded from a search query.

static final int

The extra value to indicate that the first playable item will automatically be played from the displayed search results after a search query is done.

Constants

ACTION_MEDIA_TEMPLATE_V2

Added in 1.7.0-beta03
public static final String ACTION_MEDIA_TEMPLATE_V2 = "androidx.car.app.mediaextensions.action.MEDIA_TEMPLATE_V2"

Activity Action: Provide media playing through a media template app. The usage is the same as ACTION_MEDIA_TEMPLATE A V2 is provided so that the media apps can know whether the system they run on supports the new parameters.

Input: these optional extras

If no extra is specified, the current media source is opened.

EXTRA_KEY_MEDIA_COMPONENT

Added in 1.7.0-beta03
public static final String EXTRA_KEY_MEDIA_COMPONENT = "android.car.intent.extra.MEDIA_COMPONENT"

Bundle key used as a string extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the MediaBrowserService that user wants to start the media on.

TYPE: String. The value of this extra is the same as the EXTRA_MEDIA_COMPONENT for easy access for 3P developers.

EXTRA_KEY_MEDIA_ID

Added in 1.7.0-beta03
public static final String EXTRA_KEY_MEDIA_ID = "androidx.car.app.mediaextensions.extra.KEY_MEDIA_ID"

Bundle key used as a string extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the media item that should be displayed in the browse view. Must match the ids used in the MediaBrowserServiceCompat api.

TYPE: String.

EXTRA_KEY_SEARCH_ACTION

Added in 1.7.0-beta03
public static final String EXTRA_KEY_SEARCH_ACTION = "androidx.car.app.mediaextensions.extra.KEY_SEARCH_ACTION"

Bundle key used as an int extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the action for the Media Center to do after the search query is loaded.

TYPE: int. The value will be one of the following: EXTRA_VALUE_NO_SEARCH_ACTION, EXTRA_VALUE_PLAY_FIRST_ITEM_FROM_SEARCH, This extra should only be used together with EXTRA_KEY_SEARCH_QUERY. If this extra is not specified, then no further action will be taken after the search results are loaded.

EXTRA_KEY_SEARCH_QUERY

Added in 1.7.0-beta03
public static final String EXTRA_KEY_SEARCH_QUERY = "android.car.media.extra.SEARCH_QUERY"

Bundle key used as a string extra field with ACTION_MEDIA_TEMPLATE_V2 to specify the search query to send either to the current MediaBrowserService or the one specified with EXTRA_KEY_MEDIA_COMPONENT.

TYPE: String. The value of this extra is the same as the EXTRA_SEARCH_QUERY for easy access for 3P developers.

EXTRA_VALUE_NO_SEARCH_ACTION

Added in 1.7.0-beta03
public static final int EXTRA_VALUE_NO_SEARCH_ACTION = 0

The extra value to indicate that no further action will be taken after the search results are loaded from a search query. Used with EXTRA_KEY_SEARCH_QUERY.

EXTRA_VALUE_PLAY_FIRST_ITEM_FROM_SEARCH

Added in 1.7.0-beta03
public static final int EXTRA_VALUE_PLAY_FIRST_ITEM_FROM_SEARCH = 1

The extra value to indicate that the first playable item will automatically be played from the displayed search results after a search query is done. Used with EXTRA_KEY_SEARCH_QUERY.