MediaDescriptionCompat
public final class MediaDescriptionCompat implements Parcelable
A simple set of metadata for a media item suitable for display. This can be created using the Builder or retrieved from existing metadata using getDescription.
Summary
Nested types |
|---|
public final class MediaDescriptionCompat.BuilderBuilder for |
Constants |
|
|---|---|
static final long |
The type of folder that contains folders categorized by album as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final long |
The type of folder that contains folders categorized by artist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final long |
The type of folder that contains folders categorized by genre as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final long |
The type of folder that is unknown or contains media elements of mixed types as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final long |
The type of folder that contains folders categorized by playlist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final long |
The type of folder that contains media elements only as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final long |
The type of folder that contains folders categorized by year as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final Parcelable.Creator<MediaDescriptionCompat> |
|
static final String |
EXTRA_BT_FOLDER_TYPE = "android.media.extra.BT_FOLDER_TYPE"Used as a long extra field to indicate the bluetooth folder type of the media item as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. |
static final String |
EXTRA_DOWNLOAD_STATUS = "android.media.extra.DOWNLOAD_STATUS"Used as a long extra field to indicate the download status of the media item. |
static final long |
The status value to indicate the media item is downloaded for later offline playback. |
static final long |
The status value to indicate the media item is being downloaded. |
static final long |
The status value to indicate the media item is not downloaded. |
Public methods |
|
|---|---|
int |
|
static MediaDescriptionCompat |
fromMediaDescription(Object descriptionObj)Creates an instance from a framework |
@Nullable CharSequence |
Returns a description suitable for display or null. |
@Nullable Bundle |
Returns any extras that were added to the description. |
@Nullable Bitmap |
Returns a bitmap icon suitable for display or null. |
@Nullable Uri |
Returns a Uri for an icon suitable for display or null. |
Object |
Gets the underlying framework |
@Nullable String |
Returns the media id or null. |
@Nullable Uri |
Returns a Uri representing this content or null. |
@Nullable CharSequence |
Returns a subtitle suitable for display or null. |
@Nullable CharSequence |
getTitle()Returns a title suitable for display or null. |
String |
toString() |
void |
writeToParcel(Parcel dest, int flags) |
Inherited Constants |
||||
|---|---|---|---|---|
|
Constants
BT_FOLDER_TYPE_ALBUMS
public static final long BT_FOLDER_TYPE_ALBUMS = 2
The type of folder that contains folders categorized by album as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
BT_FOLDER_TYPE_ARTISTS
public static final long BT_FOLDER_TYPE_ARTISTS = 3
The type of folder that contains folders categorized by artist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
BT_FOLDER_TYPE_GENRES
public static final long BT_FOLDER_TYPE_GENRES = 4
The type of folder that contains folders categorized by genre as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
BT_FOLDER_TYPE_MIXED
public static final long BT_FOLDER_TYPE_MIXED = 0
The type of folder that is unknown or contains media elements of mixed types as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
BT_FOLDER_TYPE_PLAYLISTS
public static final long BT_FOLDER_TYPE_PLAYLISTS = 5
The type of folder that contains folders categorized by playlist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
BT_FOLDER_TYPE_TITLES
public static final long BT_FOLDER_TYPE_TITLES = 1
The type of folder that contains media elements only as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
BT_FOLDER_TYPE_YEARS
public static final long BT_FOLDER_TYPE_YEARS = 6
The type of folder that contains folders categorized by year as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
EXTRA_BT_FOLDER_TYPE
public static final String EXTRA_BT_FOLDER_TYPE = "android.media.extra.BT_FOLDER_TYPE"
Used as a long extra field to indicate the bluetooth folder type of the media item as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. This is valid only for MediaBrowserCompat.MediaItem with FLAG_BROWSABLE. The value should be one of the following:
BT_FOLDER_TYPE_MIXEDBT_FOLDER_TYPE_TITLESBT_FOLDER_TYPE_ALBUMSBT_FOLDER_TYPE_ARTISTSBT_FOLDER_TYPE_GENRESBT_FOLDER_TYPE_PLAYLISTSBT_FOLDER_TYPE_YEARS
| See also | |
|---|---|
getExtras |
EXTRA_DOWNLOAD_STATUS
public static final String EXTRA_DOWNLOAD_STATUS = "android.media.extra.DOWNLOAD_STATUS"
Used as a long extra field to indicate the download status of the media item. The value should be one of the following:
| See also | |
|---|---|
getExtras |
STATUS_DOWNLOADED
public static final long STATUS_DOWNLOADED = 2
The status value to indicate the media item is downloaded for later offline playback.
| See also | |
|---|---|
EXTRA_DOWNLOAD_STATUS |
STATUS_DOWNLOADING
public static final long STATUS_DOWNLOADING = 1
The status value to indicate the media item is being downloaded.
| See also | |
|---|---|
EXTRA_DOWNLOAD_STATUS |
STATUS_NOT_DOWNLOADED
public static final long STATUS_NOT_DOWNLOADED = 0
The status value to indicate the media item is not downloaded.
| See also | |
|---|---|
EXTRA_DOWNLOAD_STATUS |
Public methods
fromMediaDescription
public static MediaDescriptionCompat fromMediaDescription(Object descriptionObj)
Creates an instance from a framework android.media.MediaDescription object.
This method is only supported on API 21+.
| Parameters | |
|---|---|
Object descriptionObj |
A |
| Returns | |
|---|---|
MediaDescriptionCompat |
An equivalent |
getDescription
public @Nullable CharSequence getDescription()
Returns a description suitable for display or null.
| Returns | |
|---|---|
@Nullable CharSequence |
A description or null. |
getExtras
public @Nullable Bundle getExtras()
Returns any extras that were added to the description.
getIconBitmap
public @Nullable Bitmap getIconBitmap()
Returns a bitmap icon suitable for display or null.
getIconUri
public @Nullable Uri getIconUri()
Returns a Uri for an icon suitable for display or null.
getMediaDescription
public Object getMediaDescription()
Gets the underlying framework android.media.MediaDescription object.
This method is only supported on LOLLIPOP and later.
| Returns | |
|---|---|
Object |
An equivalent |
getMediaId
public @Nullable String getMediaId()
Returns the media id or null. See METADATA_KEY_MEDIA_ID.
getMediaUri
public @Nullable Uri getMediaUri()
Returns a Uri representing this content or null.
getSubtitle
public @Nullable CharSequence getSubtitle()
Returns a subtitle suitable for display or null.
| Returns | |
|---|---|
@Nullable CharSequence |
A subtitle or null. |
getTitle
public @Nullable CharSequence getTitle()
Returns a title suitable for display or null.
| Returns | |
|---|---|
@Nullable CharSequence |
A title or null. |