MediaMetadata
public final class MediaMetadata
Metadata of a MediaItem, playlist, or a combination of multiple sources of Metadata.
Summary
Nested types |
|---|
public final class MediaMetadata.BuilderA builder for |
@DocumentedThis annotation is deprecated. Use |
@DocumentedThe type of content described by the media item. |
@DocumentedThe picture type of the artwork. |
Constants |
|
|---|---|
static final MediaMetadata |
Empty |
static final int |
This field is deprecated. Use |
static final int |
This field is deprecated. Use |
static final int |
This field is deprecated. Use |
static final int |
This field is deprecated. Use |
static final int |
FOLDER_TYPE_NONE = -1This field is deprecated. Use |
static final int |
This field is deprecated. Use |
static final int |
This field is deprecated. Use |
static final int |
This field is deprecated. Use |
static final int |
MEDIA_TYPE_ALBUM = 10
|
static final int |
MEDIA_TYPE_ARTIST = 11
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
MEDIA_TYPE_GENRE = 12
|
static final int |
MEDIA_TYPE_MIXED = 0Media of undetermined type or a mix of multiple |
static final int |
MEDIA_TYPE_MOVIE = 8
|
static final int |
MEDIA_TYPE_MUSIC = 1
|
static final int |
MEDIA_TYPE_NEWS = 5
|
static final int |
MEDIA_TYPE_PLAYLIST = 13
|
static final int |
MEDIA_TYPE_PODCAST = 16
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
MEDIA_TYPE_TV_SEASON = 19
|
static final int |
MEDIA_TYPE_TV_SERIES = 18
|
static final int |
|
static final int |
MEDIA_TYPE_VIDEO = 6
|
static final int |
MEDIA_TYPE_YEAR = 14
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
|
static final int |
Public fields |
|
|---|---|
final @Nullable CharSequence |
Optional album artist. |
final @Nullable CharSequence |
Optional album title. |
final @Nullable CharSequence |
Optional artist. |
final @Nullable byte[] |
Optional artwork data as a compressed byte array. |
final @Nullable @MediaMetadata.PictureType Integer |
Optional |
final @Nullable Uri |
Optional artwork |
final @Nullable CharSequence |
Optional compilation. |
final @Nullable CharSequence |
Optional composer. |
final @Nullable CharSequence |
Optional conductor. |
final @Nullable CharSequence |
Optional description. |
final @Nullable Integer |
Optional disc number. |
final @Nullable CharSequence |
Optional display title. |
final @Nullable Long |
Optional duration, non-negative and in milliseconds. |
final @Nullable Bundle |
Optional extras |
final @Nullable @MediaMetadata.FolderType Integer |
This field is deprecated. Use |
final @Nullable CharSequence |
Optional genre. |
final @Nullable Boolean |
Optional boolean to indicate that the media is a browsable folder. |
final @Nullable Boolean |
Optional boolean to indicate that the media is playable. |
final @Nullable @MediaMetadata.MediaType Integer |
Optional |
final @Nullable Rating |
Optional overall |
final @Nullable Integer |
Optional day of the recording date. |
final @Nullable Integer |
Optional month of the recording date. |
final @Nullable Integer |
Optional year of the recording date. |
final @Nullable Integer |
Optional day of the release date. |
final @Nullable Integer |
Optional month of the release date. |
final @Nullable Integer |
Optional year of the release date. |
final @Nullable CharSequence |
Optional name of the station streaming the media. |
final @Nullable CharSequence |
Optional subtitle. |
final ImmutableList<String> |
The IDs of the supported commands of this media item (see for instance |
final @Nullable CharSequence |
Optional title. |
final @Nullable Integer |
Optional total number of discs. |
final @Nullable Integer |
Optional total number of tracks. |
final @Nullable Integer |
Optional track number. |
final @Nullable Rating |
Optional user |
final @Nullable CharSequence |
Optional writer. |
final @Nullable Integer |
This field is deprecated. Use |
Public methods |
|
|---|---|
MediaMetadata.Builder |
Returns a new |
boolean |
Note: Equality checking does not consider |
static MediaMetadata |
@UnstableApiRestores a |
int |
hashCode() |
Bundle |
Constants
FOLDER_TYPE_ALBUMS
public static final int FOLDER_TYPE_ALBUMS = 2
Type for a folder containing media categorized by album.
FOLDER_TYPE_ARTISTS
public static final int FOLDER_TYPE_ARTISTS = 3
Type for a folder containing media categorized by artist.
FOLDER_TYPE_GENRES
public static final int FOLDER_TYPE_GENRES = 4
Type for a folder containing media categorized by genre.
FOLDER_TYPE_MIXED
public static final int FOLDER_TYPE_MIXED = 0
Type for a folder containing media of mixed types.
FOLDER_TYPE_NONE
public static final int FOLDER_TYPE_NONE = -1
Type for an item that is not a folder.
FOLDER_TYPE_PLAYLISTS
public static final int FOLDER_TYPE_PLAYLISTS = 5
Type for a folder containing a playlist.
FOLDER_TYPE_TITLES
public static final int FOLDER_TYPE_TITLES = 1
Type for a folder containing only playable media.
FOLDER_TYPE_YEARS
public static final int FOLDER_TYPE_YEARS = 6
Type for a folder containing media categorized by year.
MEDIA_TYPE_ALBUM
public static final int MEDIA_TYPE_ALBUM = 10
MediaType for a group of items (e.g., music) belonging to an album.
MEDIA_TYPE_ARTIST
public static final int MEDIA_TYPE_ARTIST = 11
MediaType for a group of items (e.g., music) from the same artist.
MEDIA_TYPE_AUDIO_BOOK
public static final int MEDIA_TYPE_AUDIO_BOOK = 15
MediaType for a group of items forming an audio book. Items in this group are typically of type MEDIA_TYPE_AUDIO_BOOK_CHAPTER.
MEDIA_TYPE_AUDIO_BOOK_CHAPTER
public static final int MEDIA_TYPE_AUDIO_BOOK_CHAPTER = 2
MediaType for an audio book chapter.
MEDIA_TYPE_FOLDER_AUDIO_BOOKS
public static final int MEDIA_TYPE_FOLDER_AUDIO_BOOKS = 26
MediaType for a folder containing audio books.
MEDIA_TYPE_FOLDER_MIXED
public static final int MEDIA_TYPE_FOLDER_MIXED = 20
MediaType for a folder with mixed or undetermined content.
MEDIA_TYPE_FOLDER_RADIO_STATIONS
public static final int MEDIA_TYPE_FOLDER_RADIO_STATIONS = 31
MediaType for a folder containing radio stations.
MEDIA_TYPE_FOLDER_TRAILERS
public static final int MEDIA_TYPE_FOLDER_TRAILERS = 34
MediaType for a folder containing movie trailers.
MEDIA_TYPE_FOLDER_TV_CHANNELS
public static final int MEDIA_TYPE_FOLDER_TV_CHANNELS = 28
MediaType for a folder containing TV channels.
MEDIA_TYPE_GENRE
public static final int MEDIA_TYPE_GENRE = 12
MediaType for a group of items (e.g., music) of the same genre.
MEDIA_TYPE_MIXED
public static final int MEDIA_TYPE_MIXED = 0
Media of undetermined type or a mix of multiple media types.
MEDIA_TYPE_PLAYLIST
public static final int MEDIA_TYPE_PLAYLIST = 13
MediaType for a group of items (e.g., music) forming a playlist.
MEDIA_TYPE_PODCAST
public static final int MEDIA_TYPE_PODCAST = 16
MediaType for a group of items belonging to a podcast. Items in this group are typically of type MEDIA_TYPE_PODCAST_EPISODE.
MEDIA_TYPE_PODCAST_EPISODE
public static final int MEDIA_TYPE_PODCAST_EPISODE = 3
MediaType for a podcast episode.
MEDIA_TYPE_RADIO_STATION
public static final int MEDIA_TYPE_RADIO_STATION = 4
MediaType for a radio station.
MEDIA_TYPE_TV_CHANNEL
public static final int MEDIA_TYPE_TV_CHANNEL = 17
MediaType for a group of items that are part of a TV channel. Items in this group are typically of type MEDIA_TYPE_TV_SHOW, MEDIA_TYPE_TV_SERIES or MEDIA_TYPE_MOVIE.
MEDIA_TYPE_TV_SEASON
public static final int MEDIA_TYPE_TV_SEASON = 19
MediaType for a group of items that are part of a TV series. Items in this group are typically of type MEDIA_TYPE_TV_SHOW.
MEDIA_TYPE_TV_SERIES
public static final int MEDIA_TYPE_TV_SERIES = 18
MediaType for a group of items that are part of a TV series. Items in this group are typically of type MEDIA_TYPE_TV_SHOW or MEDIA_TYPE_TV_SEASON.
MEDIA_TYPE_YEAR
public static final int MEDIA_TYPE_YEAR = 14
MediaType for a group of items (e.g., music) from the same year.
PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE
public static final int PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE = 16
Public fields
artworkData
public final @Nullable byte[] artworkData
Optional artwork data as a compressed byte array.
artworkDataType
@MediaMetadata.PictureType
public final @Nullable @MediaMetadata.PictureType Integer artworkDataType
Optional PictureType of the artwork data.
durationMs
public final @Nullable Long durationMs
Optional duration, non-negative and in milliseconds.
This field is populated by the app when building the metadata object and is for informational purpose only. For retrieving the duration of the media item currently being played, use getDuration instead.
extras
public final @Nullable Bundle extras
Optional extras Bundle.
Given the complexities of checking the equality of two Bundle instances, the contents of these extras are not considered in the equals and hashCode implementation.
folderType
@MediaMetadata.FolderType
public final @Nullable @MediaMetadata.FolderType Integer folderType
Optional FolderType.
isBrowsable
public final @Nullable Boolean isBrowsable
Optional boolean to indicate that the media is a browsable folder.
isPlayable
public final @Nullable Boolean isPlayable
Optional boolean to indicate that the media is playable.
mediaType
@MediaMetadata.MediaType
public final @Nullable @MediaMetadata.MediaType Integer mediaType
Optional MediaType.
recordingDay
public final @Nullable Integer recordingDay
Optional day of the recording date.
Note that there is no guarantee that the month and day are a valid combination.
recordingMonth
public final @Nullable Integer recordingMonth
Optional month of the recording date.
Note that there is no guarantee that the month and day are a valid combination.
releaseDay
public final @Nullable Integer releaseDay
Optional day of the release date.
Note that there is no guarantee that the month and day are a valid combination.
releaseMonth
public final @Nullable Integer releaseMonth
Optional month of the release date.
Note that there is no guarantee that the month and day are a valid combination.
station
public final @Nullable CharSequence station
Optional name of the station streaming the media.
subtitle
public final @Nullable CharSequence subtitle
Optional subtitle.
This is the secondary title of the media, unrelated to closed captions.
supportedCommands
@UnstableApi
public final ImmutableList<String> supportedCommands
The IDs of the supported commands of this media item (see for instance
CommandButton.sessionCommand.customAction of the Media3 session module).
Public methods
buildUpon
public MediaMetadata.Builder buildUpon()
Returns a new Builder instance with the current MediaMetadata fields.
equals
public boolean equals(@Nullable Object obj)
Note: Equality checking does not consider extras.
fromBundle
@UnstableApi
public static MediaMetadata fromBundle(Bundle bundle)
Restores a MediaMetadata from a Bundle.