public final class MediaMetadataCompat extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static interface |
MediaMetadataCompat.BitmapKey |
static class |
MediaMetadataCompat.Builder
Use to build MediaMetadata objects.
|
static interface |
MediaMetadataCompat.LongKey |
static interface |
MediaMetadataCompat.RatingKey |
static interface |
MediaMetadataCompat.TextKey |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<MediaMetadataCompat> |
CREATOR |
static String |
METADATA_KEY_ALBUM
The album title for the media.
|
static String |
METADATA_KEY_ALBUM_ART
The artwork for the album of the media's original source as a
Bitmap . |
static String |
METADATA_KEY_ALBUM_ART_URI
The artwork for the album of the media's original source as a Uri style
String.
|
static String |
METADATA_KEY_ALBUM_ARTIST
The artist for the album of the media's original source.
|
static String |
METADATA_KEY_ART
The artwork for the media as a
Bitmap . |
static String |
METADATA_KEY_ART_URI
The artwork for the media as a Uri style String.
|
static String |
METADATA_KEY_ARTIST
The artist of the media.
|
static String |
METADATA_KEY_AUTHOR
The author of the media.
|
static 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.
|
static String |
METADATA_KEY_COMPILATION
The compilation status of the media.
|
static String |
METADATA_KEY_COMPOSER
The composer of the media.
|
static String |
METADATA_KEY_DATE
The date the media was created or published.
|
static String |
METADATA_KEY_DISC_NUMBER
The disc number for the media's original source.
|
static String |
METADATA_KEY_DISPLAY_DESCRIPTION
A description that is suitable for display to the user.
|
static String |
METADATA_KEY_DISPLAY_ICON
An icon or thumbnail that is suitable for display to the user.
|
static String |
METADATA_KEY_DISPLAY_ICON_URI
An icon or thumbnail that is suitable for display to the user.
|
static String |
METADATA_KEY_DISPLAY_SUBTITLE
A subtitle that is suitable for display to the user.
|
static String |
METADATA_KEY_DISPLAY_TITLE
A title that is suitable for display to the user.
|
static String |
METADATA_KEY_DURATION
The duration of the media in ms.
|
static String |
METADATA_KEY_GENRE
The genre of the media.
|
static String |
METADATA_KEY_MEDIA_ID
A String key for identifying the content.
|
static String |
METADATA_KEY_MEDIA_URI
A Uri formatted String representing the content.
|
static String |
METADATA_KEY_NUM_TRACKS
The number of tracks in the media's original source.
|
static String |
METADATA_KEY_RATING
The overall rating for the media.
|
static String |
METADATA_KEY_TITLE
The title of the media.
|
static String |
METADATA_KEY_TRACK_NUMBER
The track number for the media.
|
static String |
METADATA_KEY_USER_RATING
The user's rating for the media.
|
static String |
METADATA_KEY_WRITER
The writer of the media.
|
static String |
METADATA_KEY_YEAR
The year the media was created or published as a long.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
Returns true if the given key is contained in the metadata
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
static MediaMetadataCompat |
fromMediaMetadata(Object metadataObj)
Creates an instance from a framework
MediaMetadata
object. |
Bitmap |
getBitmap(String key)
Return a
Bitmap for the given key or null if no bitmap exists for
the given key. |
Bundle |
getBundle()
Gets the bundle backing the metadata object.
|
MediaDescriptionCompat |
getDescription()
Returns a simple description of this metadata for display purposes.
|
long |
getLong(String key)
Returns the value associated with the given key, or 0L if no long exists
for the given key.
|
Object |
getMediaMetadata()
Gets the underlying framework
MediaMetadata object. |
RatingCompat |
getRating(String key)
Return a
RatingCompat for the given key or null if no rating exists for
the given key. |
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.
|
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.
|
Set<String> |
keySet()
Returns a Set containing the Strings used as keys in this metadata.
|
int |
size()
Get the number of fields in this metadata.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final String METADATA_KEY_TITLE
public static final String METADATA_KEY_ARTIST
public static final String METADATA_KEY_DURATION
public static final String METADATA_KEY_ALBUM
public static final String METADATA_KEY_AUTHOR
public static final String METADATA_KEY_WRITER
public static final String METADATA_KEY_COMPOSER
public static final String METADATA_KEY_COMPILATION
public static final String METADATA_KEY_DATE
public static final String METADATA_KEY_YEAR
public static final String METADATA_KEY_GENRE
public static final String METADATA_KEY_TRACK_NUMBER
public static final String METADATA_KEY_NUM_TRACKS
public static final String METADATA_KEY_DISC_NUMBER
public static final String METADATA_KEY_ALBUM_ARTIST
public static final String METADATA_KEY_ART
Bitmap
.
The artwork should be relatively small and may be scaled down
if it is too large. For higher resolution artwork
METADATA_KEY_ART_URI
should be used instead.public static final String METADATA_KEY_ART_URI
public static final String METADATA_KEY_ALBUM_ART
Bitmap
.
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
should be used instead.public static final String METADATA_KEY_ALBUM_ART_URI
public static final String METADATA_KEY_USER_RATING
RatingCompat
,
Constant Field Valuespublic static final String METADATA_KEY_RATING
RatingCompat
,
Constant Field Valuespublic static final String METADATA_KEY_DISPLAY_TITLE
METADATA_KEY_TITLE
but may differ for some formats.
When displaying media described by this metadata this should be preferred
if present.public static final String METADATA_KEY_DISPLAY_SUBTITLE
public static final String METADATA_KEY_DISPLAY_DESCRIPTION
public static final String METADATA_KEY_DISPLAY_ICON
Bitmap
.
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
should be used instead.public static final String METADATA_KEY_DISPLAY_ICON_URI
public static final String METADATA_KEY_MEDIA_ID
public static final String METADATA_KEY_MEDIA_URI
MediaControllerCompat.TransportControls#playFromUri(Uri, Bundle)
to initiate playback when provided by a MediaBrowserCompat
connected to
the same app.public static final String METADATA_KEY_BT_FOLDER_TYPE
MediaDescriptionCompat.BT_FOLDER_TYPE_MIXED
MediaDescriptionCompat.BT_FOLDER_TYPE_TITLES
MediaDescriptionCompat.BT_FOLDER_TYPE_ALBUMS
MediaDescriptionCompat.BT_FOLDER_TYPE_ARTISTS
MediaDescriptionCompat.BT_FOLDER_TYPE_GENRES
MediaDescriptionCompat.BT_FOLDER_TYPE_PLAYLISTS
MediaDescriptionCompat.BT_FOLDER_TYPE_YEARS
public static final Parcelable.Creator<MediaMetadataCompat> CREATOR
public boolean containsKey(String key)
key
- a String keypublic CharSequence getText(String key)
key
- The key the value is stored underpublic String getString(String key)
key
- The key the value is stored underpublic long getLong(String key)
key
- The key the value is stored underpublic RatingCompat getRating(String key)
RatingCompat
for the given key or null if no rating exists for
the given key.key
- The key the value is stored underRatingCompat
or nullpublic Bitmap getBitmap(String key)
Bitmap
for the given key or null if no bitmap exists for
the given key.key
- The key the value is stored underBitmap
or nullpublic MediaDescriptionCompat getDescription()
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public int size()
public Set<String> keySet()
public Bundle getBundle()
public static MediaMetadataCompat fromMediaMetadata(Object metadataObj)
MediaMetadata
object.
This method is only supported on
Build.VERSION_CODES.LOLLIPOP
and later.
metadataObj
- A MediaMetadata
object, or null
if none.MediaMetadataCompat
object, or null if
none.public Object getMediaMetadata()
MediaMetadata
object.
This method is only supported on
Build.VERSION_CODES.LOLLIPOP
and later.
MediaMetadata
object, or null
if none.