MediaDescriptionCompat


class MediaDescriptionCompat : 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

Builder for MediaDescriptionCompat objects.

Constants

const 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.

const 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.

const 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.

const 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.

const 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.

const 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.

const 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.

const Parcelable.Creator<MediaDescriptionCompat!>!
const 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.

const String!
EXTRA_DOWNLOAD_STATUS = "android.media.extra.DOWNLOAD_STATUS"

Used as a long extra field to indicate the download status of the media item.

const Long

The status value to indicate the media item is downloaded for later offline playback.

const Long

The status value to indicate the media item is being downloaded.

const Long

The status value to indicate the media item is not downloaded.

Public functions

Int
java-static MediaDescriptionCompat!
fromMediaDescription(descriptionObj: Any!)

Creates an instance from a framework android.media.MediaDescription object.

CharSequence?

Returns a description suitable for display or null.

Bundle?

Returns any extras that were added to the description.

Bitmap?

Returns a bitmap icon suitable for display or null.

Uri?

Returns a Uri for an icon suitable for display or null.

Any!

Gets the underlying framework android.media.MediaDescription object.

String?

Returns the media id or null.

Uri?

Returns a Uri representing this content or null.

CharSequence?

Returns a subtitle suitable for display or null.

CharSequence?

Returns a title suitable for display or null.

String!
Unit
writeToParcel(dest: Parcel!, flags: Int)

Constants

BT_FOLDER_TYPE_ALBUMS

Added in 1.1.0
const val BT_FOLDER_TYPE_ALBUMS = 2: 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.

BT_FOLDER_TYPE_ARTISTS

Added in 1.1.0
const val BT_FOLDER_TYPE_ARTISTS = 3: 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.

BT_FOLDER_TYPE_GENRES

Added in 1.1.0
const val BT_FOLDER_TYPE_GENRES = 4: 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.

BT_FOLDER_TYPE_MIXED

Added in 1.1.0
const val BT_FOLDER_TYPE_MIXED = 0: 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.

BT_FOLDER_TYPE_PLAYLISTS

Added in 1.1.0
const val BT_FOLDER_TYPE_PLAYLISTS = 5: 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.

BT_FOLDER_TYPE_TITLES

Added in 1.1.0
const val BT_FOLDER_TYPE_TITLES = 1: 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.

BT_FOLDER_TYPE_YEARS

Added in 1.1.0
const val BT_FOLDER_TYPE_YEARS = 6: 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.

CREATOR

Added in 1.1.0
const val CREATORParcelable.Creator<MediaDescriptionCompat!>!

EXTRA_BT_FOLDER_TYPE

Added in 1.1.0
const val EXTRA_BT_FOLDER_TYPE = "android.media.extra.BT_FOLDER_TYPE": String!

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:

See also
getExtras

EXTRA_DOWNLOAD_STATUS

Added in 1.1.0
const val EXTRA_DOWNLOAD_STATUS = "android.media.extra.DOWNLOAD_STATUS": String!

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

Added in 1.1.0
const val STATUS_DOWNLOADED = 2: Long

The status value to indicate the media item is downloaded for later offline playback.

STATUS_DOWNLOADING

Added in 1.1.0
const val STATUS_DOWNLOADING = 1: Long

The status value to indicate the media item is being downloaded.

STATUS_NOT_DOWNLOADED

Added in 1.1.0
const val STATUS_NOT_DOWNLOADED = 0: Long

The status value to indicate the media item is not downloaded.

Public functions

describeContents

Added in 1.1.0
fun describeContents(): Int

fromMediaDescription

Added in 1.1.0
java-static fun fromMediaDescription(descriptionObj: Any!): MediaDescriptionCompat!

Creates an instance from a framework android.media.MediaDescription object.

This method is only supported on API 21+.

Parameters
descriptionObj: Any!

A android.media.MediaDescription object, or null if none.

Returns
MediaDescriptionCompat!

An equivalent MediaMetadataCompat object, or null if none.

getDescription

Added in 1.1.0
fun getDescription(): CharSequence?

Returns a description suitable for display or null.

Returns
CharSequence?

A description or null.

getExtras

Added in 1.1.0
fun getExtras(): Bundle?

Returns any extras that were added to the description.

Returns
Bundle?

A bundle of extras or null.

getIconBitmap

Added in 1.1.0
fun getIconBitmap(): Bitmap?

Returns a bitmap icon suitable for display or null.

Returns
Bitmap?

An icon or null.

getIconUri

Added in 1.1.0
fun getIconUri(): Uri?

Returns a Uri for an icon suitable for display or null.

Returns
Uri?

An icon uri or null.

getMediaDescription

Added in 1.1.0
fun getMediaDescription(): Any!

Gets the underlying framework android.media.MediaDescription object.

This method is only supported on LOLLIPOP and later.

Returns
Any!

An equivalent android.media.MediaDescription object, or null if none.

getMediaId

Added in 1.1.0
fun getMediaId(): String?

Returns the media id or null. See METADATA_KEY_MEDIA_ID.

getMediaUri

Added in 1.1.0
fun getMediaUri(): Uri?

Returns a Uri representing this content or null.

Returns
Uri?

A media Uri or null.

getSubtitle

Added in 1.1.0
fun getSubtitle(): CharSequence?

Returns a subtitle suitable for display or null.

Returns
CharSequence?

A subtitle or null.

getTitle

Added in 1.1.0
fun getTitle(): CharSequence?

Returns a title suitable for display or null.

Returns
CharSequence?

A title or null.

toString

fun toString(): String!

writeToParcel

Added in 1.1.0
fun writeToParcel(dest: Parcel!, flags: Int): Unit