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 |
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 |
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 |
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? |
getTitle()Returns a title suitable for display or null. |
String! |
toString() |
Unit |
writeToParcel(dest: Parcel!, flags: Int) |
Constants
BT_FOLDER_TYPE_ALBUMS
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
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
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
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
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
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
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.
EXTRA_BT_FOLDER_TYPE
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:
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
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
const val STATUS_DOWNLOADED = 2: Long
The status value to indicate the media item is downloaded for later offline playback.
| See also | |
|---|---|
EXTRA_DOWNLOAD_STATUS |
STATUS_DOWNLOADING
const val STATUS_DOWNLOADING = 1: Long
The status value to indicate the media item is being downloaded.
| See also | |
|---|---|
EXTRA_DOWNLOAD_STATUS |
STATUS_NOT_DOWNLOADED
const val STATUS_NOT_DOWNLOADED = 0: Long
The status value to indicate the media item is not downloaded.
| See also | |
|---|---|
EXTRA_DOWNLOAD_STATUS |
Public functions
fromMediaDescription
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 |
| Returns | |
|---|---|
MediaDescriptionCompat! |
An equivalent |
getDescription
fun getDescription(): CharSequence?
Returns a description suitable for display or null.
| Returns | |
|---|---|
CharSequence? |
A description or null. |
getExtras
fun getExtras(): Bundle?
Returns any extras that were added to the description.
| Returns | |
|---|---|
Bundle? |
A bundle of extras or null. |
getIconBitmap
fun getIconBitmap(): Bitmap?
Returns a bitmap icon suitable for display or null.
| Returns | |
|---|---|
Bitmap? |
An icon or null. |
getIconUri
fun getIconUri(): Uri?
Returns a Uri for an icon suitable for display or null.
| Returns | |
|---|---|
Uri? |
An icon uri or null. |
getMediaDescription
fun getMediaDescription(): Any!
Gets the underlying framework android.media.MediaDescription object.
This method is only supported on LOLLIPOP and later.
| Returns | |
|---|---|
Any! |
An equivalent |
getMediaId
fun getMediaId(): String?
Returns the media id or null. See METADATA_KEY_MEDIA_ID.
getMediaUri
fun getMediaUri(): Uri?
Returns a Uri representing this content or null.
| Returns | |
|---|---|
Uri? |
A media Uri or null. |
getSubtitle
fun getSubtitle(): CharSequence?
Returns a subtitle suitable for display or null.
| Returns | |
|---|---|
CharSequence? |
A subtitle or null. |
getTitle
fun getTitle(): CharSequence?
Returns a title suitable for display or null.
| Returns | |
|---|---|
CharSequence? |
A title or null. |