java.lang.Object
↳androidx.media.utils.MediaConstants
Gradle dependencies
compile group: 'androidx.media', name: 'media', version: '1.6.0'
- groupId: androidx.media
- artifactId: media
- version: 1.6.0
Artifact androidx.media:media:1.6.0 it located at Google repository (https://maven.google.com/)
Androidx artifact mapping:
androidx.media:media com.android.support:support-media-compat
Overview
Media constants for sharing constants between media provider and consumer apps
Summary
Fields |
---|
public static final java.lang.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. |
public static final java.lang.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 android.support.v4.media.MediaBrowserCompat . |
public static final java.lang.String | BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS Bundle key passed through root hints to the MediaBrowserServiceCompat to indicate
which flags exposed by from children of the
root node are supported by the hosting android.support.v4.media.MediaBrowserCompat . |
public static final java.lang.String | BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT Bundle key sent through getExtras to the android.support.v4.media.MediaBrowserCompat to indicate that the MediaBrowserServiceCompat supports showing
a settings page. |
public static final java.lang.String | BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED Bundle key sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate that the MediaBrowserServiceCompat supports the
method MediaBrowserServiceCompat.onSearch(String, Bundle, MediaBrowserServiceCompat.Result>) . |
public static final java.lang.String | DESCRIPTION_EXTRAS_KEY_COMPLETION_PERCENTAGE Bundle key sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate an amount of completion progress for the corresponding
. |
public static final java.lang.String | DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS Bundle key sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate the playback completion status of the corresponding . |
public static final java.lang.String | DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE Bundle key passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat to indicate a preference about how browsable instances of are presented. |
public static final java.lang.String | DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE Bundle key sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate that certain instances of are related as a group, with a title that is specified through
the bundle value. |
public static final java.lang.String | DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE Bundle key passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat to indicate a preference about how playable instances of are presented. |
public static final java.lang.String | DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_SINGLE_ITEM Bundle key sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate a preference about how the corresponding is presented. |
public static final int | DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED Bundle value sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate that the corresponding
has been fully played by the user. |
public static final int | DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED Bundle value sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate that the corresponding
has not been played by the user. |
public static final int | DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED Bundle value sent through getExtras to the hosting android.support.v4.media.MediaBrowserCompat to indicate that the corresponding
has been partially played by the user. |
public static final int | DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM Bundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat to indicate a preference that browsable instances of should be presented as "category" grid items. |
public static final int | DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM Bundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat to indicate a preference that browsable instances of should be presented as "category" list items. |
public static final int | DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM Bundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat to indicate a preference that certain instances of should be presented as grid items. |
public static final int | DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM Bundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat to indicate a preference that certain instances of should be presented as list items. |
public static final java.lang.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). |
public static final java.lang.String | METADATA_KEY_IS_ADVERTISEMENT Key sent through a key-value mapping in getLong or in the
getExtras bundle to the hosting android.support.v4.media.MediaBrowserCompat
to indicate that the corresponding android.support.v4.media.MediaMetadataCompat or is an advertisement. |
public static final java.lang.String | METADATA_KEY_IS_EXPLICIT Key sent through a key-value mapping in getLong or in the
getExtras bundle to the hosting android.support.v4.media.MediaBrowserCompat
to indicate that the corresponding android.support.v4.media.MediaMetadataCompat or has explicit content (i.e. |
public static final java.lang.String | 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. |
public static final java.lang.String | 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. |
public static final long | METADATA_VALUE_ATTRIBUTE_PRESENT Value sent through a key-value mapping of android.support.v4.media.MediaMetadataCompat , or through extras on a different data type, to indicate the presence of an attribute described
by its corresponding key. |
public static final java.lang.String | PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT Bundle key passed through getExtras to the hosting android.support.v4.media.session.MediaControllerCompat which maps to a pending intent. |
public static final java.lang.String | PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL Bundle key passed through getExtras to the hosting android.support.v4.media.session.MediaControllerCompat which maps to a label. |
public static final java.lang.String | PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_USING_CAR_APP_LIBRARY_INTENT Bundle key passed through getExtras to the android.support.v4.media.session.MediaControllerCompat which maps to an intent. |
public static final java.lang.String | PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID Bundle key used for the media id in playback state extras. |
public static final java.lang.String | SESSION_EXTRAS_KEY_ACCOUNT_NAME Bundle key used for the account name in session extras. |
public static final java.lang.String | SESSION_EXTRAS_KEY_ACCOUNT_TYPE Bundle key used for the account type in session extras. |
public static final java.lang.String | SESSION_EXTRAS_KEY_AUTHTOKEN Bundle key used for the account auth token value in session
extras. |
public static final java.lang.String | SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT Bundle key passed from android.support.v4.media.session.MediaSessionCompat to the hosting android.support.v4.media.session.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. |
public static final java.lang.String | SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV Bundle key passed from android.support.v4.media.session.MediaSessionCompat to the hosting android.support.v4.media.session.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. |
public static final java.lang.String | TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE Bundle key passed through the extras of
,
,
,
,
, or
to indicate the
stream type to be used by the session when playing or preparing the media. |
public static final java.lang.String | TRANSPORT_CONTROLS_EXTRAS_KEY_SHUFFLE Bundle key passed through the extras of
,
,
,
,
, or
to indicate whether
the session should shuffle the media to be played or not. |
Methods |
---|
from java.lang.Object | clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Fields
public static final java.lang.String
SESSION_EXTRAS_KEY_ACCOUNT_NAMEBundle key used for the account name in session
extras.
TYPE: String
See also: getExtras
, setExtras
public static final java.lang.String
SESSION_EXTRAS_KEY_ACCOUNT_TYPEBundle key used for the account type in session
extras. The value
would vary across media applications.
TYPE: String
See also: getExtras
, setExtras
public static final java.lang.String
SESSION_EXTRAS_KEY_AUTHTOKENBundle key used for the account auth token value in session
extras. The value would vary across media applications.
TYPE: byte[]
See also: getExtras
, setExtras
public static final java.lang.String
SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXTBundle key passed from android.support.v4.media.session.MediaSessionCompat
to the hosting android.support.v4.media.session.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
See also: getExtras
, setExtras
public static final java.lang.String
SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREVBundle key passed from android.support.v4.media.session.MediaSessionCompat
to the hosting android.support.v4.media.session.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
See also: getExtras
, setExtras
public static final java.lang.String
METADATA_KEY_CONTENT_IDBundle 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
See also: android.support.v4.media.MediaMetadataCompat
public static final java.lang.String
METADATA_KEY_NEXT_EPISODE_CONTENT_IDBundle 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
See also: android.support.v4.media.MediaMetadataCompat
public static final java.lang.String
METADATA_KEY_SERIES_CONTENT_IDBundle 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
See also: android.support.v4.media.MediaMetadataCompat
public static final java.lang.String
METADATA_KEY_IS_EXPLICITKey sent through a key-value mapping in getLong
or in the
getExtras
bundle to the hosting android.support.v4.media.MediaBrowserCompat
to indicate that the corresponding android.support.v4.media.MediaMetadataCompat
or has explicit content (i.e. user discretion is advised when
viewing or listening to this content).
TYPE: long (to enable, use value MediaConstants.METADATA_VALUE_ATTRIBUTE_PRESENT)
See also: getLong
, getExtras
public static final java.lang.String
METADATA_KEY_IS_ADVERTISEMENTKey sent through a key-value mapping in getLong
or in the
getExtras
bundle to the hosting android.support.v4.media.MediaBrowserCompat
to indicate that the corresponding android.support.v4.media.MediaMetadataCompat
or is an advertisement.
TYPE: long (to enable, use value MediaConstants.METADATA_VALUE_ATTRIBUTE_PRESENT)
See also: getLong
, getExtras
public static final long
METADATA_VALUE_ATTRIBUTE_PRESENTValue sent through a key-value mapping of android.support.v4.media.MediaMetadataCompat
, or through extras on a different data type, to indicate the presence of an attribute described
by its corresponding key.
See also: getLong
public static final java.lang.String
BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_LIMITBundle 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 android.support.v4.media.MediaBrowserCompat
. Excess root children may be omitted or made less discoverable by the
host.
TYPE: int
See also: MediaBrowserServiceCompat.onGetRoot(String, int, Bundle), MediaBrowserServiceCompat.getBrowserRootHints(), MediaBrowserCompat
public static final java.lang.String
BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGSBundle key passed through root hints to the MediaBrowserServiceCompat to indicate
which flags exposed by from children of the
root node are supported by the hosting android.support.v4.media.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 is nonzero, then
the host supports browsable root children. Conversely, if the masked result is zero, then the
host does not support them.
See also: MediaBrowserServiceCompat.onGetRoot(String, int, Bundle), MediaBrowserServiceCompat.getBrowserRootHints(), MediaBrowserCompat
public static final java.lang.String
BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELSBundle 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.
See also: MediaBrowserServiceCompat.onGetRoot(String, int, Bundle), MediaBrowserServiceCompat.getBrowserRootHints(), MediaBrowserCompat
, getIconUri
, getIconBitmap
public static final java.lang.String
BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENTBundle key sent through getExtras
to the android.support.v4.media.MediaBrowserCompat
to indicate that the MediaBrowserServiceCompat supports showing
a settings page. The intent should have the component name set to a Car App Library service
which exists in the same package as the media browser service.
TYPE: . Should be inserted into the Bundle .
See also: getExtras
, MediaConstants.PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT
public static final java.lang.String
BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTEDBundle key sent through getExtras
to the hosting android.support.v4.media.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
See also: getExtras
public static final java.lang.String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLEBundle key passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat
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.
See also: getExtras
, getExtras
, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM
public static final java.lang.String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLEBundle key passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat
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.
See also: getExtras
, getExtras
, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM
public static final java.lang.String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_SINGLE_ITEMBundle key sent through getExtras
to the hosting android.support.v4.media.MediaBrowserCompat
to indicate a preference about how the corresponding is presented.
This preference takes precedence over those expressed by MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE and MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE.
TYPE: int. Possible values are separate constants.
See also: getExtras
, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM, MediaConstants.DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM
public static final int
DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEMBundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat
to indicate a preference that certain instances of should be presented as list items.
See also: MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE, MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE
public static final int
DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEMBundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat
to indicate a preference that certain instances of should be presented as grid items.
See also: MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE, MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE
public static final int
DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEMBundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat
to indicate a preference that browsable instances of 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.
See also: MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE
public static final int
DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEMBundle value passed from the MediaBrowserServiceCompat to the hosting android.support.v4.media.MediaBrowserCompat
to indicate a preference that browsable instances of 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.
See also: MediaConstants.DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE
public static final java.lang.String
DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLEBundle key sent through getExtras
to the hosting android.support.v4.media.MediaBrowserCompat
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
public static final java.lang.String
DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUSBundle key sent through getExtras
to the hosting android.support.v4.media.MediaBrowserCompat
to indicate the playback completion status of the corresponding .
TYPE: int. Possible values are separate constants.
See also: getExtras
, MediaConstants.DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED, MediaConstants.DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED, MediaConstants.DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED
public static final int
DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYEDBundle value sent through getExtras
to the hosting android.support.v4.media.MediaBrowserCompat
to indicate that the corresponding
has not been played by the user.
See also: getExtras
, MediaConstants.DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS
public static final int
DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYEDBundle value sent through getExtras
to the hosting android.support.v4.media.MediaBrowserCompat
to indicate that the corresponding
has been partially played by the user.
See also: getExtras
, MediaConstants.DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS
public static final int
DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYEDBundle value sent through getExtras
to the hosting android.support.v4.media.MediaBrowserCompat
to indicate that the corresponding
has been fully played by the user.
See also: getExtras
, MediaConstants.DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS
public static final java.lang.String
DESCRIPTION_EXTRAS_KEY_COMPLETION_PERCENTAGEBundle key sent through getExtras
to the hosting android.support.v4.media.MediaBrowserCompat
to indicate an amount of completion progress for the corresponding
. 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
public static final java.lang.String
PLAYBACK_STATE_EXTRAS_KEY_MEDIA_IDBundle 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
public static final java.lang.String
PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABELBundle key passed through getExtras
to the hosting android.support.v4.media.session.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
getErrorMessage
.
TYPE: String. Should be human readable and localized.
See also: getExtras
, MediaConstants.PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT
public static final java.lang.String
PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENTBundle key passed through getExtras
to the hosting android.support.v4.media.session.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. The key MediaConstants.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.
TYPE: PendingIntent. Should be inserted into the Bundle .
See also: getExtras
, MediaConstants.PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL, MediaConstants.BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT
public static final java.lang.String
PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_USING_CAR_APP_LIBRARY_INTENTBundle key passed through getExtras
to the android.support.v4.media.session.MediaControllerCompat
which maps to an intent. When launched, the intent 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 package as the media browser
service.
TYPE: . Should be inserted into the Bundle .
See also: getExtras
public static final java.lang.String
TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPEBundle key passed through the extras of
,
,
,
,
, or
to indicate the
stream type to be used by the session when playing or preparing the media.
TYPE: int
See also:
public static final java.lang.String
TRANSPORT_CONTROLS_EXTRAS_KEY_SHUFFLEBundle key passed through the extras of
,
,
,
,
, or
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
See also:
Source
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.media.utils;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.media.MediaBrowserCompat;
import android.support.v4.media.MediaBrowserCompat.ConnectionCallback;
import android.support.v4.media.MediaDescriptionCompat;
import android.support.v4.media.MediaMetadataCompat;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.MediaSessionCompat;
import android.support.v4.media.session.PlaybackStateCompat;
import androidx.annotation.RestrictTo;
import androidx.media.MediaBrowserServiceCompat;
/** Media constants for sharing constants between media provider and consumer apps */
public final class MediaConstants {
/**
* Bundle key used for the account name in {@link MediaSessionCompat session} extras.
*
* <p>TYPE: String
*
* @see MediaControllerCompat#getExtras
* @see MediaSessionCompat#setExtras
*/
@SuppressLint("IntentName")
public static final String SESSION_EXTRAS_KEY_ACCOUNT_NAME =
"androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_NAME";
/**
* Bundle key used for the account type in {@link MediaSessionCompat session} extras. The value
* would vary across media applications.
*
* <p>TYPE: String
*
* @see MediaControllerCompat#getExtras
* @see MediaSessionCompat#setExtras
*/
@SuppressLint("IntentName")
public static final String SESSION_EXTRAS_KEY_ACCOUNT_TYPE =
"androidx.media.MediaSessionCompat.Extras.KEY_ACCOUNT_TYPE";
/**
* Bundle key used for the account auth token value in {@link MediaSessionCompat session}
* extras. The value would vary across media applications.
*
* <p>TYPE: byte[]
*
* @see MediaControllerCompat#getExtras
* @see MediaSessionCompat#setExtras
* @hide
*/
@RestrictTo(LIBRARY)
@SuppressLint("IntentName")
public static final String SESSION_EXTRAS_KEY_AUTHTOKEN =
"androidx.media.MediaSessionCompat.Extras.KEY_AUTHTOKEN";
/**
* Bundle key passed from {@link MediaSessionCompat} to the hosting {@link
* 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 {@link
* PlaybackStateCompat#ACTION_SKIP_TO_NEXT skip to next standard action} is not supported. This
* may be used when the session temporarily hides skip to next by design.
*
* <p>TYPE: boolean
*
* @see MediaControllerCompat#getExtras()
* @see MediaSessionCompat#setExtras(Bundle)
*/
@SuppressLint("IntentName")
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 {@link MediaSessionCompat} to the hosting {@link
* 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 {@link
* PlaybackStateCompat#ACTION_SKIP_TO_PREVIOUS skip to previous standard action} is not
* supported. This may be used when the session temporarily hides skip to previous by design.
*
* <p>TYPE: boolean
*
* @see MediaControllerCompat#getExtras()
* @see MediaSessionCompat#setExtras(Bundle)
*/
@SuppressLint("IntentName")
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 used for media content id in {@link MediaMetadataCompat metadata}, should contain
* the same ID provided to
* <a href="https://developers.google.com/actions/media">Media Actions Catalog</a> 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.
*
* <p>TYPE: String
*
* @see MediaMetadataCompat
*/
@SuppressLint("IntentName")
public static final String METADATA_KEY_CONTENT_ID =
"androidx.media.MediaMetadatCompat.METADATA_KEY_CONTENT_ID";
/**
* Bundle key used for next episode's media content ID in {@link MediaMetadataCompat metadata},
* following the same ID and format provided to
* <a href="https://developers.google.com/actions/media">Media Actions Catalog</a> 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.
*
* <p>TYPE: String
*
* @see MediaMetadataCompat
*/
@SuppressLint("IntentName")
public static final String METADATA_KEY_NEXT_EPISODE_CONTENT_ID =
"androidx.media.MediaMetadatCompat.METADATA_KEY_NEXT_EPISODE_CONTENT_ID";
/**
* Bundle key used for the TV series's media content ID in {@link MediaMetadataCompat metadata},
* following the same ID and format provided to
* <a href="https://developers.google.com/actions/media">Media Actions Catalog</a> 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.
*
* <p>TYPE: String
*
* @see MediaMetadataCompat
*/
@SuppressLint("IntentName")
public static final String METADATA_KEY_SERIES_CONTENT_ID =
"androidx.media.MediaMetadatCompat.METADATA_KEY_SERIES_CONTENT_ID";
/**
* Key sent through a key-value mapping in {@link MediaMetadataCompat#getLong(String)} or in the
* {@link MediaDescriptionCompat#getExtras()} bundle to the hosting {@link MediaBrowserCompat}
* to indicate that the corresponding {@link MediaMetadataCompat} or {@link
* MediaBrowserCompat.MediaItem} has explicit content (i.e. user discretion is advised when
* viewing or listening to this content).
*
* <p>TYPE: long (to enable, use value {@link #METADATA_VALUE_ATTRIBUTE_PRESENT})
*
* @see MediaMetadataCompat#getLong(String)
* @see MediaMetadataCompat.Builder#putLong(String, long)
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
*/
@SuppressLint("IntentName")
public static final String METADATA_KEY_IS_EXPLICIT = "android.media.IS_EXPLICIT";
/**
* Key sent through a key-value mapping in {@link MediaMetadataCompat#getLong(String)} or in the
* {@link MediaDescriptionCompat#getExtras()} bundle to the hosting {@link MediaBrowserCompat}
* to indicate that the corresponding {@link MediaMetadataCompat} or {@link
* MediaBrowserCompat.MediaItem} is an advertisement.
*
* <p>TYPE: long (to enable, use value {@link #METADATA_VALUE_ATTRIBUTE_PRESENT})
*
* @see MediaMetadataCompat#getLong(String)
* @see MediaMetadataCompat.Builder#putLong(String, long)
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
*/
@SuppressLint("IntentName")
public static final String METADATA_KEY_IS_ADVERTISEMENT =
"android.media.metadata.ADVERTISEMENT";
/**
* Value sent through a key-value mapping of {@link MediaMetadataCompat}, or through {@link
* Bundle} extras on a different data type, to indicate the presence of an attribute described
* by its corresponding key.
*
* @see MediaMetadataCompat#getLong(String)
* @see MediaMetadataCompat.Builder#putLong(String, long)
*/
public static final long METADATA_VALUE_ATTRIBUTE_PRESENT = 1L;
/**
* Bundle key passed through root hints to the {@link MediaBrowserServiceCompat} to indicate the
* maximum number of children of the root node that can be supported by the hosting {@link
* MediaBrowserCompat}. Excess root children may be omitted or made less discoverable by the
* host.
*
* <p>TYPE: int
*
* @see MediaBrowserServiceCompat#onGetRoot(String, int, Bundle)
* @see MediaBrowserServiceCompat#getBrowserRootHints()
* @see MediaBrowserCompat#MediaBrowserCompat(Context,ComponentName,ConnectionCallback,Bundle)
*/
@SuppressLint("IntentName")
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 {@link MediaBrowserServiceCompat} to indicate
* which flags exposed by {@link MediaBrowserCompat.MediaItem#getFlags()} from children of the
* root node are supported by the hosting {@link MediaBrowserCompat}. Root children with
* unsupported flags may be omitted or made less discoverable by the host.
*
* <p>TYPE: int, a bit field which can be used as a mask. For example, if the value masked
* (using bitwise AND) with {@link 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.
*
* @see MediaBrowserServiceCompat#onGetRoot(String, int, Bundle)
* @see MediaBrowserServiceCompat#getBrowserRootHints()
* @see MediaBrowserCompat#MediaBrowserCompat(Context,ComponentName,ConnectionCallback,Bundle)
*/
@SuppressLint("IntentName")
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 {@link 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.
*
* @see MediaBrowserServiceCompat#onGetRoot(String, int, Bundle)
* @see MediaBrowserServiceCompat#getBrowserRootHints()
* @see MediaBrowserCompat#MediaBrowserCompat(Context,ComponentName,ConnectionCallback,Bundle)
* @see MediaDescriptionCompat#getIconUri()
* @see MediaDescriptionCompat.Builder#setIconUri(Uri)
* @see MediaDescriptionCompat#getIconBitmap()
* @see MediaDescriptionCompat.Builder#setIconBitmap(Bitmap)
*/
@SuppressLint("IntentName")
public static final String BROWSER_ROOT_HINTS_KEY_MEDIA_ART_SIZE_PIXELS =
"android.media.extras.MEDIA_ART_SIZE_HINT_PIXELS";
/**
* Bundle key sent through {@link MediaBrowserCompat#getExtras()} to the {@link
* MediaBrowserCompat} to indicate that the {@link MediaBrowserServiceCompat} supports showing
* a settings page. The intent should have the component name set to a Car App Library service
* which exists in the same package as the media browser service.
*
* <p>TYPE: {@link Intent}. Should be inserted into the Bundle {@link
* Bundle#putParcelable(String, Parcelable) as a Parcelable}.
*
* @see MediaBrowserCompat#getExtras()
* @see MediaBrowserServiceCompat.BrowserRoot#BrowserRoot(String, Bundle)
* @see #PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT
*/
@SuppressLint("IntentName")
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 sent through {@link MediaBrowserCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate that the {@link MediaBrowserServiceCompat} supports the
* method {@link MediaBrowserServiceCompat#onSearch(String, Bundle,
* MediaBrowserServiceCompat.Result)}. If sent as {@code true}, the host may expose affordances
* which call the search method.
*
* <p>TYPE: boolean
*
* @see MediaBrowserCompat#getExtras()
* @see MediaBrowserServiceCompat.BrowserRoot#BrowserRoot(String, Bundle)
*/
@SuppressLint("IntentName")
public static final String BROWSER_SERVICE_EXTRAS_KEY_SEARCH_SUPPORTED =
"android.media.browse.SEARCH_SUPPORTED";
/**
* Bundle key passed from the {@link MediaBrowserServiceCompat} to the hosting {@link
* MediaBrowserCompat} to indicate a preference about how playable instances of {@link
* MediaBrowserCompat.MediaItem} are presented.
*
* <p>If exposed through {@link MediaBrowserCompat#getExtras()}, the preference applies to all
* playable items within the browse tree.
*
* <p>If exposed through {@link MediaDescriptionCompat#getExtras()}, the preference applies to
* only the immediate playable children of the corresponding browsable item. It takes precedence
* over preferences sent through {@link MediaBrowserCompat#getExtras()}.
*
* <p>TYPE: int. Possible values are separate constants.
*
* @see MediaBrowserCompat#getExtras()
* @see MediaBrowserServiceCompat.BrowserRoot#BrowserRoot(String, Bundle)
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM
*/
@SuppressLint("IntentName")
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE =
"android.media.browse.CONTENT_STYLE_PLAYABLE_HINT";
/**
* Bundle key passed from the {@link MediaBrowserServiceCompat} to the hosting {@link
* MediaBrowserCompat} to indicate a preference about how browsable instances of {@link
* MediaBrowserCompat.MediaItem} are presented.
*
* <p>If exposed through {@link MediaBrowserCompat#getExtras()}, the preference applies to all
* browsable items within the browse tree.
*
* <p>If exposed through {@link MediaDescriptionCompat#getExtras()}, the preference applies to
* only the immediate browsable children of the corresponding browsable item. It takes
* precedence over preferences sent through {@link MediaBrowserCompat#getExtras()}.
*
* <p>TYPE: int. Possible values are separate constants.
*
* @see MediaBrowserCompat#getExtras()
* @see MediaBrowserServiceCompat.BrowserRoot#BrowserRoot(String, Bundle)
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM
*/
@SuppressLint("IntentName")
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE =
"android.media.browse.CONTENT_STYLE_BROWSABLE_HINT";
/**
* Bundle key sent through {@link MediaDescriptionCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate a preference about how the corresponding {@link
* MediaBrowserCompat.MediaItem} is presented.
*
* <p>This preference takes precedence over those expressed by {@link
* #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE} and {@link
* #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE}.
*
* <p>TYPE: int. Possible values are separate constants.
*
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM
* @see #DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM
*/
@SuppressLint("IntentName")
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_SINGLE_ITEM =
"android.media.browse.CONTENT_STYLE_SINGLE_ITEM_HINT";
/**
* Bundle value passed from the {@link MediaBrowserServiceCompat} to the hosting {@link
* MediaBrowserCompat} to indicate a preference that certain instances of {@link
* MediaBrowserCompat.MediaItem} should be presented as list items.
*
* @see #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE
* @see #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE
*/
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM = 1;
/**
* Bundle value passed from the {@link MediaBrowserServiceCompat} to the hosting {@link
* MediaBrowserCompat} to indicate a preference that certain instances of {@link
* MediaBrowserCompat.MediaItem} should be presented as grid items.
*
* @see #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE
* @see #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_PLAYABLE
*/
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM = 2;
/**
* Bundle value passed from the {@link MediaBrowserServiceCompat} to the hosting {@link
* MediaBrowserCompat} to indicate a preference that browsable instances of {@link
* MediaBrowserCompat.MediaItem} should be presented as "category" list items. This means the
* items provide icons that render well when they do <strong>not</strong> fill all of the
* available area.
*
* @see #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE
*/
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM = 3;
/**
* Bundle value passed from the {@link MediaBrowserServiceCompat} to the hosting {@link
* MediaBrowserCompat} to indicate a preference that browsable instances of {@link
* MediaBrowserCompat.MediaItem} should be presented as "category" grid items. This means the
* items provide icons that render well when they do <strong>not</strong> fill all of the
* available area.
*
* @see #DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_BROWSABLE
*/
public static final int DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM = 4;
/**
* Bundle key sent through {@link MediaDescriptionCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate that certain instances of {@link
* 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.
*
* <p>TYPE: String. Should be human readable and localized.
*
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
*/
@SuppressLint("IntentName")
public static final String DESCRIPTION_EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE =
"android.media.browse.CONTENT_STYLE_GROUP_TITLE_HINT";
/**
* Bundle key sent through {@link MediaDescriptionCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate the playback completion status of the corresponding {@link
* MediaBrowserCompat.MediaItem}.
*
* <p>TYPE: int. Possible values are separate constants.
*
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
* @see #DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED
* @see #DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED
* @see #DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED
*/
@SuppressLint("IntentName")
public static final String DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS =
"android.media.extra.PLAYBACK_STATUS";
/**
* Bundle value sent through {@link MediaDescriptionCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate that the corresponding {@link MediaBrowserCompat.MediaItem}
* has not been played by the user.
*
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
* @see #DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS
*/
public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_NOT_PLAYED = 0;
/**
* Bundle value sent through {@link MediaDescriptionCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate that the corresponding {@link MediaBrowserCompat.MediaItem}
* has been partially played by the user.
*
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
* @see #DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS
*/
public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED = 1;
/**
* Bundle value sent through {@link MediaDescriptionCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate that the corresponding {@link MediaBrowserCompat.MediaItem}
* has been fully played by the user.
*
* @see MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
* @see #DESCRIPTION_EXTRAS_KEY_COMPLETION_STATUS
*/
public static final int DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_FULLY_PLAYED = 2;
/**
* Bundle key sent through {@link MediaDescriptionCompat#getExtras()} to the hosting {@link
* MediaBrowserCompat} to indicate an amount of completion progress for the corresponding
* {@link MediaBrowserCompat.MediaItem}. This extra augments {@link
* #DESCRIPTION_EXTRAS_VALUE_COMPLETION_STATUS_PARTIALLY_PLAYED the partially played status} by
* indicating how much has been played by the user.
*
* <p>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 MediaDescriptionCompat#getExtras()
* @see MediaDescriptionCompat.Builder#setExtras(Bundle)
*/
@SuppressLint("IntentName")
public static final String DESCRIPTION_EXTRAS_KEY_COMPLETION_PERCENTAGE =
"androidx.media.MediaItem.Extras.COMPLETION_PERCENTAGE";
/**
* Bundle key used for the media id in {@link PlaybackStateCompat playback state} extras. It's
* for associating the playback state with the media being played so the value is expected to be
* same with {@link MediaMetadataCompat#METADATA_KEY_MEDIA_ID media id} of the current metadata.
*
* <p>TYPE: String
*
* @see PlaybackStateCompat#getExtras
* @see PlaybackStateCompat.Builder#setExtras
*/
@SuppressLint("IntentName")
public static final String PLAYBACK_STATE_EXTRAS_KEY_MEDIA_ID =
"androidx.media.PlaybackStateCompat.Extras.KEY_MEDIA_ID";
/**
* Bundle key passed through {@link PlaybackStateCompat#getExtras()} to the hosting {@link
* MediaControllerCompat} which maps to a label. The label is associated with {@link
* #PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT the action} that allow users to
* resolve the current playback state error.
*
* <p>The label should be short; a more detailed explanation can be provided to the user via
* {@link PlaybackStateCompat#getErrorMessage()}.
*
* <p>TYPE: String. Should be human readable and localized.
*
* @see PlaybackStateCompat#getExtras()
* @see PlaybackStateCompat.Builder#setExtras(Bundle)
* @see #PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT
*/
@SuppressLint("IntentName")
public static final String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL =
"android.media.extras.ERROR_RESOLUTION_ACTION_LABEL";
/**
* Bundle key passed through {@link PlaybackStateCompat#getExtras()} to the hosting {@link
* MediaControllerCompat} which maps to a pending intent. When launched, the intent should allow
* users to resolve the current playback state error. {@link
* #PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL A label} should be included in the
* same Bundle. The key {@link
* #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.
*
* <p>TYPE: PendingIntent. Should be inserted into the Bundle {@link
* Bundle#putParcelable(String, Parcelable) as a Parcelable}.
*
* @see PlaybackStateCompat#getExtras()
* @see PlaybackStateCompat.Builder#setExtras(Bundle)
* @see #PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_LABEL
* @see #BROWSER_SERVICE_EXTRAS_KEY_APPLICATION_PREFERENCES_USING_CAR_APP_LIBRARY_INTENT
*/
@SuppressLint("IntentName")
public static final String PLAYBACK_STATE_EXTRAS_KEY_ERROR_RESOLUTION_ACTION_INTENT =
"android.media.extras.ERROR_RESOLUTION_ACTION_INTENT";
/**
* Bundle key passed through {@link PlaybackStateCompat#getExtras()} to the {@link
* MediaControllerCompat} which maps to an intent. When launched, the intent 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 package as the media browser
* service.
*
* <p>TYPE: {@link Intent}. Should be inserted into the Bundle {@link
* Bundle#putParcelable(String, Parcelable) as a Parcelable}.
*
* @see PlaybackStateCompat#getExtras()
* @see PlaybackStateCompat.Builder#setExtras(Bundle)
*/
@SuppressLint("IntentName")
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 the {@code extras} of
* {@link MediaControllerCompat.TransportControls#prepareFromMediaId(String, Bundle)},
* {@link MediaControllerCompat.TransportControls#prepareFromSearch(String, Bundle)},
* {@link MediaControllerCompat.TransportControls#prepareFromUri(Uri, Bundle)},
* {@link MediaControllerCompat.TransportControls#playFromMediaId(String, Bundle)},
* {@link MediaControllerCompat.TransportControls#playFromSearch(String, Bundle)}, or
* {@link MediaControllerCompat.TransportControls#playFromUri(Uri, Bundle)} to indicate the
* stream type to be used by the session when playing or preparing the media.
*
* <p>TYPE: int
*
* @see MediaControllerCompat.TransportControls#prepareFromMediaId(String, Bundle)
* @see MediaControllerCompat.TransportControls#prepareFromSearch(String, Bundle)
* @see MediaControllerCompat.TransportControls#prepareFromUri(Uri, Bundle)
* @see MediaControllerCompat.TransportControls#playFromMediaId(String, Bundle)
* @see MediaControllerCompat.TransportControls#playFromSearch(String, Bundle)
* @see MediaControllerCompat.TransportControls#playFromUri(Uri, Bundle)
*/
@SuppressLint("IntentName")
public static final String TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE =
"android.media.session.extra.LEGACY_STREAM_TYPE";
/**
* Bundle key passed through the {@code extras} of
* {@link MediaControllerCompat.TransportControls#prepareFromMediaId(String, Bundle)},
* {@link MediaControllerCompat.TransportControls#prepareFromSearch(String, Bundle)},
* {@link MediaControllerCompat.TransportControls#prepareFromUri(Uri, Bundle)},
* {@link MediaControllerCompat.TransportControls#playFromMediaId(String, Bundle)},
* {@link MediaControllerCompat.TransportControls#playFromSearch(String, Bundle)}, or
* {@link MediaControllerCompat.TransportControls#playFromUri(Uri, Bundle)} 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 {@link MediaSessionCompat#setShuffleMode(int)
* shuffle mode}.
*
* <p>TYPE: boolean
*
* @see MediaControllerCompat.TransportControls#prepareFromMediaId(String, Bundle)
* @see MediaControllerCompat.TransportControls#prepareFromSearch(String, Bundle)
* @see MediaControllerCompat.TransportControls#prepareFromUri(Uri, Bundle)
* @see MediaControllerCompat.TransportControls#playFromMediaId(String, Bundle)
* @see MediaControllerCompat.TransportControls#playFromSearch(String, Bundle)
* @see MediaControllerCompat.TransportControls#playFromUri(Uri, Bundle)
*/
@SuppressLint("IntentName")
public static final String TRANSPORT_CONTROLS_EXTRAS_KEY_SHUFFLE =
"androidx.media.MediaControllerCompat.TransportControls.extras.KEY_SHUFFLE";
private MediaConstants() {}
}