# MediaMetadataCompat

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#nestedclasses)\|[Constants](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#constants)\|[Inherited Constants](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#inhconstants)\|[Fields](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#lfields)\|[Methods](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#)  

# MediaMetadataCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
MediaMetadataCompat
`  
`

extends Object


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable.html)`


`

|---|----------------------------------------------|
| java.lang.Object                                ||
| ↳ | android.support.v4.media.MediaMetadataCompat |

<br />

*** ** * ** ***

Contains metadata about an item, such as the title, artist, etc.

## Summary

|                                                                            ### Nested classes                                                                             ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [MediaMetadataCompat.Builder](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat.Builder) Use to build MediaMetadata objects. |

|                                                                                                                                        ### Constants                                                                                                                                         ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `String` | [METADATA_KEY_ADVERTISEMENT](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ADVERTISEMENT) Whether the media is an advertisement.                                                                                               |
| `String` | [METADATA_KEY_ALBUM](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ALBUM) The album title for the media.                                                                                                                       |
| `String` | [METADATA_KEY_ALBUM_ART](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ALBUM_ART) The artwork for the album of the media's original source as a[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html). |
| `String` | [METADATA_KEY_ALBUM_ARTIST](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ALBUM_ARTIST) The artist for the album of the media's original source.                                                                               |
| `String` | [METADATA_KEY_ALBUM_ART_URI](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ALBUM_ART_URI) The artwork for the album of the media's original source as a Uri style String.                                                      |
| `String` | [METADATA_KEY_ART](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ART) The artwork for the media as a[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html).                                            |
| `String` | [METADATA_KEY_ARTIST](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ARTIST) The artist of the media.                                                                                                                           |
| `String` | [METADATA_KEY_ART_URI](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ART_URI) The artwork for the media as a Uri style String.                                                                                                 |
| `String` | [METADATA_KEY_AUTHOR](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_AUTHOR) The author of the media.                                                                                                                           |
| `String` | [METADATA_KEY_BT_FOLDER_TYPE](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_BT_FOLDER_TYPE) The bluetooth folder type of the media specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.                               |
| `String` | [METADATA_KEY_COMPILATION](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_COMPILATION) The compilation status of the media.                                                                                                     |
| `String` | [METADATA_KEY_COMPOSER](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_COMPOSER) The composer of the media.                                                                                                                     |
| `String` | [METADATA_KEY_DATE](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DATE) The date the media was created or published.                                                                                                           |
| `String` | [METADATA_KEY_DISC_NUMBER](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DISC_NUMBER) The disc number for the media's original source.                                                                                         |
| `String` | [METADATA_KEY_DISPLAY_DESCRIPTION](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DISPLAY_DESCRIPTION) A description that is suitable for display to the user.                                                                  |
| `String` | [METADATA_KEY_DISPLAY_ICON](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DISPLAY_ICON) An icon or thumbnail that is suitable for display to the user.                                                                         |
| `String` | [METADATA_KEY_DISPLAY_ICON_URI](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DISPLAY_ICON_URI) An icon or thumbnail that is suitable for display to the user.                                                                 |
| `String` | [METADATA_KEY_DISPLAY_SUBTITLE](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DISPLAY_SUBTITLE) A subtitle that is suitable for display to the user.                                                                           |
| `String` | [METADATA_KEY_DISPLAY_TITLE](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DISPLAY_TITLE) A title that is suitable for display to the user.                                                                                    |
| `String` | [METADATA_KEY_DOWNLOAD_STATUS](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DOWNLOAD_STATUS) The download status of the media which will be used for later offline playback.                                                  |
| `String` | [METADATA_KEY_DURATION](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DURATION) The duration of the media in ms.                                                                                                               |
| `String` | [METADATA_KEY_GENRE](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_GENRE) The genre of the media.                                                                                                                              |
| `String` | [METADATA_KEY_MEDIA_ID](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_MEDIA_ID) A String key for identifying the content.                                                                                                      |
| `String` | [METADATA_KEY_MEDIA_URI](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_MEDIA_URI) A Uri formatted String representing the content.                                                                                             |
| `String` | [METADATA_KEY_NUM_TRACKS](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_NUM_TRACKS) The number of tracks in the media's original source.                                                                                       |
| `String` | [METADATA_KEY_RATING](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_RATING) The overall rating for the media.                                                                                                                  |
| `String` | [METADATA_KEY_TITLE](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_TITLE) The title of the media.                                                                                                                              |
| `String` | [METADATA_KEY_TRACK_NUMBER](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_TRACK_NUMBER) The track number for the media.                                                                                                        |
| `String` | [METADATA_KEY_USER_RATING](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_USER_RATING) The user's rating for the media.                                                                                                         |
| `String` | [METADATA_KEY_WRITER](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_WRITER) The writer of the media.                                                                                                                           |
| `String` | [METADATA_KEY_YEAR](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_YEAR) The year the media was created or published as a long.                                                                                                 |

|                                                                                                                                                                            ### Inherited constants                                                                                                                                                                             |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#)From interface` android.os.Parcelable ` |-------|----------------------------------------| | `int` | `CONTENTS_FILE_DESCRIPTOR` <br />      | | `int` | `PARCELABLE_WRITE_RETURN_VALUE` <br /> | |

|                                                                                                                                                                  ### Fields                                                                                                                                                                   ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| ` public static final `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator.html)`<`[MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat)`>` | [CREATOR](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#CREATOR) <br /> |

|                                                                                                                                                                                                                ### Public methods                                                                                                                                                                                                                 ||
|-----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean`                                                                                                            | ` `[containsKey](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#containsKey(java.lang.String))`(String key) ` Returns true if the given key is contained in the metadata                                                                                                             |
| ` int`                                                                                                                | ` `[describeContents](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#describeContents())`() `                                                                                                                                                                                        |
| ` static `[MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat) | ` `[fromMediaMetadata](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#fromMediaMetadata(java.lang.Object))`(Object metadataObj) ` Creates an instance from a framework[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata.html)object.               |
| ` `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)                                     | ` `[getBitmap](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getBitmap(java.lang.String))`(String key) ` Return a[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)for the given key or null if no bitmap exists for the given key.                     |
| ` `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                           | ` `[getBundle](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getBundle())`() ` Gets the bundle backing the metadata object.                                                                                                                                                         |
| ` `[MediaDescriptionCompat](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat)  | ` `[getDescription](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getDescription())`() ` Returns a simple description of this metadata for display purposes.                                                                                                                        |
| ` long`                                                                                                               | ` `[getLong](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getLong(java.lang.String))`(String key) ` Returns the value associated with the given key, or 0L if no long exists for the given key.                                                                                    |
| ` Object`                                                                                                             | ` `[getMediaMetadata](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getMediaMetadata())`() ` Gets the underlying framework[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata.html)object.                                                          |
| ` `[RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)                      | ` `[getRating](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getRating(java.lang.String))`(String key) ` Return a[RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)for the given key or null if no rating exists for the given key.      |
| ` String`                                                                                                             | ` `[getString](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getString(java.lang.String))`(String key) ` Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
| ` CharSequence`                                                                                                       | ` `[getText](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#getText(java.lang.String))`(String key) ` Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.     |
| ` Set<String>`                                                                                                        | ` `[keySet](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#keySet())`() ` Returns a Set containing the Strings used as keys in this metadata.                                                                                                                                        |
| ` int`                                                                                                                | ` `[size](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#size())`() ` Get the number of fields in this metadata.                                                                                                                                                                     |
| ` void`                                                                                                               | ` `[writeToParcel](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#writeToParcel(android.os.Parcel, int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel.html)` dest, int flags) `                                                                              |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4-media/MediaDescriptionCompat#)From interface` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html)` ` |------------------|--------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` describeContents() `                                                                                       | | ` abstract void` | ` writeToParcel(`[Parcel](https://developer.android.com/reference/android/os/Parcel.html)` arg0, int arg1) ` | ||

## Constants

### METADATA_KEY_ADVERTISEMENT

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ADVERTISEMENT
```

Whether the media is an advertisement. A value of 0 indicates it is not an advertisement. A value of 1 or non-zero indicates it is an advertisement. If not specified, this value is set to 0 by default.

<br />

Constant Value: "android.media.metadata.ADVERTISEMENT"  

### METADATA_KEY_ALBUM

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ALBUM
```

The album title for the media.

<br />

Constant Value: "android.media.metadata.ALBUM"  

### METADATA_KEY_ALBUM_ART

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ALBUM_ART
```

The artwork for the album of the media's original source as a[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html). The artwork should be relatively small and may be scaled down if it is too large. For higher resolution artwork[METADATA_KEY_ALBUM_ART_URI](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ALBUM_ART_URI)should be used instead.

<br />

Constant Value: "android.media.metadata.ALBUM_ART"  

### METADATA_KEY_ALBUM_ARTIST

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ALBUM_ARTIST
```

The artist for the album of the media's original source.

<br />

Constant Value: "android.media.metadata.ALBUM_ARTIST"  

### METADATA_KEY_ALBUM_ART_URI

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ALBUM_ART_URI
```

The artwork for the album of the media's original source as a Uri style String.

<br />

Constant Value: "android.media.metadata.ALBUM_ART_URI"  

### METADATA_KEY_ART

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ART
```

The artwork for the media as a[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html). The artwork should be relatively small and may be scaled down if it is too large. For higher resolution artwork[METADATA_KEY_ART_URI](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_ART_URI)should be used instead.

<br />

Constant Value: "android.media.metadata.ART"  

### METADATA_KEY_ARTIST

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ARTIST
```

The artist of the media.

<br />

Constant Value: "android.media.metadata.ARTIST"  

### METADATA_KEY_ART_URI

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_ART_URI
```

The artwork for the media as a Uri style String.

<br />

Constant Value: "android.media.metadata.ART_URI"  

### METADATA_KEY_AUTHOR

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_AUTHOR
```

The author of the media.

<br />

Constant Value: "android.media.metadata.AUTHOR"  

### METADATA_KEY_BT_FOLDER_TYPE

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_BT_FOLDER_TYPE
```

The bluetooth folder type of the media specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. It should be one of the following:

- [BT_FOLDER_TYPE_MIXED](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#BT_FOLDER_TYPE_MIXED)
- [BT_FOLDER_TYPE_TITLES](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#BT_FOLDER_TYPE_TITLES)
- [BT_FOLDER_TYPE_ALBUMS](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#BT_FOLDER_TYPE_ALBUMS)
- [BT_FOLDER_TYPE_ARTISTS](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#BT_FOLDER_TYPE_ARTISTS)
- [BT_FOLDER_TYPE_GENRES](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#BT_FOLDER_TYPE_GENRES)
- [BT_FOLDER_TYPE_PLAYLISTS](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#BT_FOLDER_TYPE_PLAYLISTS)
- [BT_FOLDER_TYPE_YEARS](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#BT_FOLDER_TYPE_YEARS)

<br />

<br />

Constant Value: "android.media.metadata.BT_FOLDER_TYPE"  

### METADATA_KEY_COMPILATION

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_COMPILATION
```

The compilation status of the media.

<br />

Constant Value: "android.media.metadata.COMPILATION"  

### METADATA_KEY_COMPOSER

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_COMPOSER
```

The composer of the media.

<br />

Constant Value: "android.media.metadata.COMPOSER"  

### METADATA_KEY_DATE

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DATE
```

The date the media was created or published. The format is unspecified but RFC 3339 is recommended.

<br />

Constant Value: "android.media.metadata.DATE"  

### METADATA_KEY_DISC_NUMBER

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DISC_NUMBER
```

The disc number for the media's original source.

<br />

Constant Value: "android.media.metadata.DISC_NUMBER"  

### METADATA_KEY_DISPLAY_DESCRIPTION

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DISPLAY_DESCRIPTION
```

A description that is suitable for display to the user. When displaying more information for media described by this metadata this should be preferred to other fields if present.

<br />

Constant Value: "android.media.metadata.DISPLAY_DESCRIPTION"  

### METADATA_KEY_DISPLAY_ICON

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DISPLAY_ICON
```

An icon or thumbnail that is suitable for display to the user. When displaying an icon for media described by this metadata this should be preferred to other fields if present. This must be a[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html). The icon should be relatively small and may be scaled down if it is too large. For higher resolution artwork[METADATA_KEY_DISPLAY_ICON_URI](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DISPLAY_ICON_URI)should be used instead.

<br />

Constant Value: "android.media.metadata.DISPLAY_ICON"  

### METADATA_KEY_DISPLAY_ICON_URI

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DISPLAY_ICON_URI
```

An icon or thumbnail that is suitable for display to the user. When displaying more information for media described by this metadata the display description should be preferred to other fields when present. This must be a Uri style String.

<br />

Constant Value: "android.media.metadata.DISPLAY_ICON_URI"  

### METADATA_KEY_DISPLAY_SUBTITLE

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DISPLAY_SUBTITLE
```

A subtitle that is suitable for display to the user. When displaying a second line for media described by this metadata this should be preferred to other fields if present.

<br />

Constant Value: "android.media.metadata.DISPLAY_SUBTITLE"  

### METADATA_KEY_DISPLAY_TITLE

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DISPLAY_TITLE
```

A title that is suitable for display to the user. This will generally be the same as[METADATA_KEY_TITLE](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_TITLE)but may differ for some formats. When displaying media described by this metadata this should be preferred if present.

<br />

Constant Value: "android.media.metadata.DISPLAY_TITLE"  

### METADATA_KEY_DOWNLOAD_STATUS

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DOWNLOAD_STATUS
```

The download status of the media which will be used for later offline playback. It should be one of the following:

- [STATUS_NOT_DOWNLOADED](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#STATUS_NOT_DOWNLOADED)
- [STATUS_DOWNLOADING](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#STATUS_DOWNLOADING)
- [STATUS_DOWNLOADED](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat#STATUS_DOWNLOADED)

<br />

<br />

Constant Value: "android.media.metadata.DOWNLOAD_STATUS"  

### METADATA_KEY_DURATION

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_DURATION
```

The duration of the media in ms. A negative duration indicates that the duration is unknown (or infinite).

<br />

Constant Value: "android.media.metadata.DURATION"  

### METADATA_KEY_GENRE

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_GENRE
```

The genre of the media.

<br />

Constant Value: "android.media.metadata.GENRE"  

### METADATA_KEY_MEDIA_ID

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_MEDIA_ID
```

A String key for identifying the content. This value is specific to the service providing the content. If used, this should be a persistent unique key for the underlying content.

<br />

Constant Value: "android.media.metadata.MEDIA_ID"  

### METADATA_KEY_MEDIA_URI

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_MEDIA_URI
```

A Uri formatted String representing the content. This value is specific to the service providing the content. It may be used with[playFromUri(Uri, Bundle)](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromUri(android.net.Uri, android.os.Bundle))to initiate playback when provided by a[MediaBrowserCompat](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat)connected to the same app.

<br />

Constant Value: "android.media.metadata.MEDIA_URI"  

### METADATA_KEY_NUM_TRACKS

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_NUM_TRACKS
```

The number of tracks in the media's original source.

<br />

Constant Value: "android.media.metadata.NUM_TRACKS"  

### METADATA_KEY_RATING

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_RATING
```

The overall rating for the media.

<br />

**See also:**

- [RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)

Constant Value: "android.media.metadata.RATING"  

### METADATA_KEY_TITLE

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_TITLE
```

The title of the media.

<br />

Constant Value: "android.media.metadata.TITLE"  

### METADATA_KEY_TRACK_NUMBER

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_TRACK_NUMBER
```

The track number for the media.

<br />

Constant Value: "android.media.metadata.TRACK_NUMBER"  

### METADATA_KEY_USER_RATING

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_USER_RATING
```

The user's rating for the media.

<br />

**See also:**

- [RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)

Constant Value: "android.media.metadata.USER_RATING"  

### METADATA_KEY_WRITER

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_WRITER
```

The writer of the media.

<br />

Constant Value: "android.media.metadata.WRITER"  

### METADATA_KEY_YEAR

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String METADATA_KEY_YEAR
```

The year the media was created or published as a long.

<br />

Constant Value: "android.media.metadata.YEAR"

## Fields

### CREATOR

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Creator<MediaMetadataCompat> CREATOR
```

<br />

<br />

## Public methods

### containsKey

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean containsKey (String key)
```

Returns true if the given key is contained in the metadata

<br />

|              Parameters              ||
|-------|-------------------------------|
| `key` | `String`: a String key <br /> |

|                                  Returns                                   ||
|-----------|-----------------------------------------------------------------|
| `boolean` | true if the key exists in this metadata, false otherwise <br /> |

### describeContents

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int describeContents ()
```

<br />

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### fromMediaMetadata

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
MediaMetadataCompat fromMediaMetadata (Object metadataObj)
```

Creates an instance from a framework[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata.html)object.

This method is only supported on[LOLLIPOP](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#LOLLIPOP)and later.

<br />

<br />

|                                                                     Parameters                                                                     ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------|
| `metadataObj` | `Object`: A[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata.html)object, or null if none. <br /> |

|                                                                                                                               Returns                                                                                                                                ||
|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat) | An equivalent[MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat)object, or null if none. <br /> |

### getBitmap

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Bitmap getBitmap (String key)
```

Return a[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)for the given key or null if no bitmap exists for the given key.

<br />

|                        Parameters                         ||
|-------|----------------------------------------------------|
| `key` | `String`: The key the value is stored under <br /> |

|                                                                                    Returns                                                                                    ||
|--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html) | A[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)or null <br /> |

### getBundle

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Bundle getBundle ()
```

Gets the bundle backing the metadata object. This is available to support backwards compatibility. Apps should not modify the bundle directly.

<br />

|                                                      Returns                                                       ||
|--------------------------------------------------------------------------|------------------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html) | The Bundle backing this metadata. <br /> |

### getDescription

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
MediaDescriptionCompat getDescription ()
```

Returns a simple description of this metadata for display purposes.

<br />

|                                                                             Returns                                                                              ||
|-------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
| [MediaDescriptionCompat](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat) | A simple description of this metadata. <br /> |

### getLong

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
long getLong (String key)
```

Returns the value associated with the given key, or 0L if no long exists for the given key.

<br />

|                        Parameters                         ||
|-------|----------------------------------------------------|
| `key` | `String`: The key the value is stored under <br /> |

|           Returns           ||
|--------|---------------------|
| `long` | a long value <br /> |

### getMediaMetadata

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Object getMediaMetadata ()
```

Gets the underlying framework[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata.html)object.

This method is only supported on[LOLLIPOP](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#LOLLIPOP)and later.

<br />

<br />

|                                                                     Returns                                                                     ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------|
| `Object` | An equivalent[MediaMetadata](https://developer.android.com/reference/android/media/MediaMetadata.html)object, or null if none. <br /> |

### getRating

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
RatingCompat getRating (String key)
```

Return a[RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)for the given key or null if no rating exists for the given key.

<br />

|                        Parameters                         ||
|-------|----------------------------------------------------|
| `key` | `String`: The key the value is stored under <br /> |

|                                                                                                   Returns                                                                                                   ||
|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| [RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat) | A[RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)or null <br /> |

### getString

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getString (String key)
```

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

<br />

|                        Parameters                         ||
|-------|----------------------------------------------------|
| `key` | `String`: The key the value is stored under <br /> |

|                 Returns                  ||
|----------|--------------------------------|
| `String` | a String value, or null <br /> |

### getText

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
CharSequence getText (String key)
```

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

<br />

|                        Parameters                         ||
|-------|----------------------------------------------------|
| `key` | `String`: The key the value is stored under <br /> |

|                       Returns                        ||
|----------------|--------------------------------------|
| `CharSequence` | a CharSequence value, or null <br /> |

### keySet

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Set<String> keySet ()
```

Returns a Set containing the Strings used as keys in this metadata.

<br />

|                  Returns                   ||
|---------------|-----------------------------|
| `Set<String>` | a Set of String keys <br /> |

### size

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int size ()
```

Get the number of fields in this metadata.

<br />

|                       Returns                       ||
|-------|----------------------------------------------|
| `int` | The number of fields in the metadata. <br /> |

### writeToParcel

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void writeToParcel (Parcel dest,
                int flags)
```

<br />

<br />

|        Parameters        ||
|---------|-----------------|
| `dest`  | `Parcel` <br /> |
| `flags` | `int` <br />    |

-

  ## Classes

  - [AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat)
  - [AudioAttributesCompat.Builder](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder)
  - [MediaBrowserCompat](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat)
  - [MediaBrowserCompat.ConnectionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.ConnectionCallback)
  - [MediaBrowserCompat.CustomActionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.CustomActionCallback)
  - [MediaBrowserCompat.ItemCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.ItemCallback)
  - [MediaBrowserCompat.MediaItem](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem)
  - [MediaBrowserCompat.SearchCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SearchCallback)
  - [MediaBrowserCompat.SubscriptionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback)
  - [MediaBrowserServiceCompat](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat)
  - [MediaBrowserServiceCompat.BrowserRoot](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat.BrowserRoot)
  - [MediaBrowserServiceCompat.Result](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat.Result)
  - [MediaDescriptionCompat](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat)
  - [MediaDescriptionCompat.Builder](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat.Builder)
  - [MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat)
  - [MediaMetadataCompat.Builder](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat.Builder)
  - [RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)
  - [VolumeProviderCompat](https://developer.android.com/reference/android/support/v4/media/VolumeProviderCompat)
  - [VolumeProviderCompat.Callback](https://developer.android.com/reference/android/support/v4/media/VolumeProviderCompat.Callback)