MediaMetadata

extends Object

java.lang.Object

↳

com.google.android.gms.cast.MediaMetadata

Class Overview

Container class for media metadata. Metadata has a media type, an optional
list of images, and a collection of metadata fields. Keys for common
metadata fields are predefined as constants, but the application is free to
define and use additional fields of its own.

The values of the predefined fields have predefined types. For example, a track number is
an int and a creation date is a String containing an ISO-8601
representation of a date and time. Attempting to store a value of an incorrect type in a field
will result in a IllegalArgumentException.

Note that the Cast protocol limits which metadata fields can be used for a given media type.
When a MediaMetadata object is serialized to JSON for delivery to a Cast receiver, any
predefined fields which are not supported for a given media type will not be included in the
serialized form, but any application-defined fields will always be included.

Constants

public
static
final
String
KEY_ALBUM_ARTIST

String key: Album artist.

The name of the artist who produced an album. For example, in compilation albums such as DJ
mixes, the album artist is not necessarily the same as the artist(s) of the individual songs
on the album. This value is suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.ALBUM_ARTIST"

public
static
final
String
KEY_ALBUM_TITLE

String key: Album title.

The title of the album that a music track belongs to. This value is suitable for display
purposes.

Constant Value:
"com.google.android.gms.cast.metadata.ALBUM_TITLE"

public
static
final
String
KEY_ARTIST

String key: Artist.

The name of the artist who created the media. For example, this could be the name of a
musician, performer, or photographer. This value is suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.ARTIST"

public
static
final
String
KEY_BROADCAST_DATE

String key: Broadcast date.

The value is the date and/or time at which the media was first broadcast, in ISO-8601 format.
For example, this could be the date that a TV show episode was first aired.

Constant Value:
"com.google.android.gms.cast.metadata.BROADCAST_DATE"

public
static
final
String
KEY_COMPOSER

String key: Composer.

The name of the composer of a music track. This value is suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.COMPOSER"

public
static
final
String
KEY_CREATION_DATE

String key: Creation date.

The value is the date and/or time at which the media was created, in ISO-8601 format.
For example, this could be the date and time at which a photograph was taken or a piece of
music was recorded.

Constant Value:
"com.google.android.gms.cast.metadata.CREATION_DATE"

public
static
final
String
KEY_DISC_NUMBER

Integer key: Disc number.

The disc number (counting from 1) that a music track belongs to in a multi-disc album.

Constant Value:
"com.google.android.gms.cast.metadata.DISC_NUMBER"

public
static
final
String
KEY_EPISODE_NUMBER

Integer key: Episode number.

The number of an episode in a given season of a TV show. Typically episode numbers are
counted starting from 1, however this value may be 0 if it is a "pilot" episode that is not
considered to be an official episode of the first season.

Constant Value:
"com.google.android.gms.cast.metadata.EPISODE_NUMBER"

public
static
final
String
KEY_HEIGHT

Integer key: Height.
The height of a piece of media, in pixels. This would typically be used for providing the
dimensions of a photograph.

Constant Value:
"com.google.android.gms.cast.metadata.HEIGHT"

public
static
final
String
KEY_LOCATION_LATITUDE

Double key: Location latitude.

The latitude component of the geographical location where a piece of media was created.
For example, this could be the location of a photograph or the principal filming location of
a movie.

public
static
final
String
KEY_LOCATION_NAME

String key: Location name.

The name of a location where a piece of media was created. For example, this could be the
location of a photograph or the principal filming location of a movie. This value is
suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.LOCATION_NAME"

public
static
final
String
KEY_RELEASE_DATE

String key: Release date.

The value is the date and/or time at which the media was released, in ISO-8601 format.
For example, this could be the date that a movie or music album was released.

Constant Value:
"com.google.android.gms.cast.metadata.RELEASE_DATE"

public
static
final
String
KEY_SEASON_NUMBER

Integer key: Season number.

The season number that a TV show episode belongs to. Typically season numbers are counted
starting from 1, however this value may be 0 if it is a "pilot" episode that predates the
official start of a TV series.

Constant Value:
"com.google.android.gms.cast.metadata.SEASON_NUMBER"

public
static
final
String
KEY_SERIES_TITLE

String key: Series title.

The name of a series. For example, this could be the name of a TV show or series of related
music albums. This value is suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.SERIES_TITLE"

public
static
final
String
KEY_STUDIO

String key: Studio.

The name of a recording studio that produced a piece of media. For example, this could be
the name of a movie studio or music label. This value is suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.STUDIO"

public
static
final
String
KEY_SUBTITLE

String key: Subtitle.

The subtitle of the media. This value is suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.SUBTITLE"

public
static
final
String
KEY_TITLE

String key: Title.

The title of the media. For example, this could be the title of a song, movie, or TV show
episode. This value is suitable for display purposes.

Constant Value:
"com.google.android.gms.cast.metadata.TITLE"

public
static
final
String
KEY_TRACK_NUMBER

Integer key: Track number.

The track number of a music track on an album disc. Typically track numbers are counted
starting from 1, however this value may be 0 if it is a "hidden track" at the beginning of
an album.

Constant Value:
"com.google.android.gms.cast.metadata.TRACK_NUMBER"

public
static
final
String
KEY_WIDTH

Integer key: Width.
The width of a piece of media, in pixels. This would typically be used for providing the
dimensions of a photograph.

Constant Value:
"com.google.android.gms.cast.metadata.WIDTH"

public
static
final
int
MEDIA_TYPE_GENERIC

A media type representing generic media content.

Constant Value:
0
(0x00000000)

public
static
final
int
MEDIA_TYPE_MOVIE

A media type representing a movie.

Constant Value:
1
(0x00000001)

public
static
final
int
MEDIA_TYPE_MUSIC_TRACK

A media type representing a music track.

Constant Value:
3
(0x00000003)

public
static
final
int
MEDIA_TYPE_PHOTO

A media type representing a photo.

Constant Value:
4
(0x00000004)

public
static
final
int
MEDIA_TYPE_TV_SHOW

A media type representing an TV show.

Constant Value:
2
(0x00000002)

public
static
final
int
MEDIA_TYPE_USER

The smallest media type value that can be assigned for application-defined media types.