docs/doc/reference/com/google/android/exoplayer2/MediaMetadata.Builder.html
Package com.google.android.exoplayer2
Enclosing class:MediaMetadata
public static final classMediaMetadata.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
A builder for MediaMetadata instances.
Constructors | Constructor | Description |
| --- | --- |
| Builder() | |
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| MediaMetadata | build() |
Returns a new MediaMetadata instance with the current builder values.
|
| MediaMetadata.Builder | maybeSetArtworkData(byte[] artworkData, @com.google.android.exoplayer2.MediaMetadata.PictureType int artworkDataType) |
Sets the artwork data as a compressed byte array in the event that the associated MediaMetadata.PictureType is MediaMetadata.PICTURE_TYPE_FRONT_COVER, the existing MediaMetadata.PictureType is not MediaMetadata.PICTURE_TYPE_FRONT_COVER, or the current artworkData is not set.
|
| MediaMetadata.Builder | populate(MediaMetadata mediaMetadata) |
Populates all the fields from mediaMetadata, provided they are non-null.
|
| MediaMetadata.Builder | populateFromMetadata(Metadata metadata) |
Sets all fields supported by the entries within the Metadata.
|
| MediaMetadata.Builder | populateFromMetadata(List<Metadata> metadataList) |
Sets all fields supported by the entries within the list of Metadata.
|
| MediaMetadata.Builder | setAlbumArtist(CharSequence albumArtist) |
Sets the album artist.
|
| MediaMetadata.Builder | setAlbumTitle(CharSequence albumTitle) |
Sets the album title.
|
| MediaMetadata.Builder | setArtist(CharSequence artist) |
Sets the artist.
|
| MediaMetadata.Builder | setArtworkData(byte[] artworkData) |
Deprecated.
Use setArtworkData(byte[] data, Integer pictureType) or maybeSetArtworkData(byte[] data, int pictureType), providing a MediaMetadata.PictureType.
|
| MediaMetadata.Builder | setArtworkData(byte[] artworkData, @PictureType Integer artworkDataType) |
Sets the artwork data as a compressed byte array with an associated artworkDataType.
|
| MediaMetadata.Builder | setArtworkUri(Uri artworkUri) |
Sets the artwork Uri.
|
| MediaMetadata.Builder | setCompilation(CharSequence compilation) |
Sets the compilation.
|
| MediaMetadata.Builder | setComposer(CharSequence composer) |
Sets the composer.
|
| MediaMetadata.Builder | setConductor(CharSequence conductor) |
Sets the conductor.
|
| MediaMetadata.Builder | setDescription(CharSequence description) |
Sets the description.
|
| MediaMetadata.Builder | setDiscNumber(Integer discNumber) |
Sets the disc number.
|
| MediaMetadata.Builder | setDisplayTitle(CharSequence displayTitle) |
Sets the display title.
|
| MediaMetadata.Builder | setExtras(Bundle extras) |
Sets the extras Bundle.
|
| MediaMetadata.Builder | setFolderType(@FolderType Integer folderType) |
Deprecated.
Use setIsBrowsable(java.lang.Boolean) to indicate if an item is a browsable folder and use setMediaType(java.lang.Integer) to indicate the type of the folder.
|
| MediaMetadata.Builder | setGenre(CharSequence genre) |
Sets the genre.
|
| MediaMetadata.Builder | setIsBrowsable(Boolean isBrowsable) |
Sets whether the media is a browsable folder.
|
| MediaMetadata.Builder | setIsPlayable(Boolean isPlayable) |
Sets whether the media is playable.
|
| MediaMetadata.Builder | setMediaType(@MediaType Integer mediaType) |
Sets the MediaMetadata.MediaType.
|
| MediaMetadata.Builder | setOverallRating(Rating overallRating) |
Sets the overall Rating.
|
| MediaMetadata.Builder | setRecordingDay(Integer recordingDay) |
Sets the day of the recording date.
|
| MediaMetadata.Builder | setRecordingMonth(Integer recordingMonth) |
Sets the month of the recording date.
|
| MediaMetadata.Builder | setRecordingYear(Integer recordingYear) |
Sets the year of the recording date.
|
| MediaMetadata.Builder | setReleaseDay(Integer releaseDay) |
Sets the day of the release date.
|
| MediaMetadata.Builder | setReleaseMonth(Integer releaseMonth) |
Sets the month of the release date.
|
| MediaMetadata.Builder | setReleaseYear(Integer releaseYear) |
Sets the year of the release date.
|
| MediaMetadata.Builder | setStation(CharSequence station) |
Sets the name of the station streaming the media.
|
| MediaMetadata.Builder | setSubtitle(CharSequence subtitle) |
Sets the subtitle.
|
| MediaMetadata.Builder | setTitle(CharSequence title) |
Sets the title.
|
| MediaMetadata.Builder | setTotalDiscCount(Integer totalDiscCount) |
Sets the total number of discs.
|
| MediaMetadata.Builder | setTotalTrackCount(Integer totalTrackCount) |
Sets the total number of tracks.
|
| MediaMetadata.Builder | setTrackNumber(Integer trackNumber) |
Sets the track number.
|
| MediaMetadata.Builder | setUserRating(Rating userRating) |
Sets the user Rating.
|
| MediaMetadata.Builder | setWriter(CharSequence writer) |
Sets the writer.
|
| MediaMetadata.Builder | setYear(Integer year) |
Deprecated.
Use setRecordingYear(Integer) instead.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public Builder()
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setTitle(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")title)
Sets the title.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setArtist(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")artist)
Sets the artist.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setAlbumTitle(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")albumTitle)
Sets the album title.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setAlbumArtist(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")albumArtist)
Sets the album artist.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setDisplayTitle(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")displayTitle)
Sets the display title.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setSubtitle(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")subtitle)
Sets the subtitle.
This is the secondary title of the media, unrelated to closed captions.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setDescription(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")description)
Sets the description.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setUserRating(@Nullable[Rating](Rating.html "class in com.google.android.exoplayer2")userRating)
Sets the user Rating.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setOverallRating(@Nullable[Rating](Rating.html "class in com.google.android.exoplayer2")overallRating)
Sets the overall Rating.
-
@CanIgnoreReturnValue[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setArtworkData(@Nullable
byte[] artworkData)
Deprecated.
Use setArtworkData(byte[] data, Integer pictureType) or maybeSetArtworkData(byte[] data, int pictureType), providing a MediaMetadata.PictureType.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setArtworkData(@Nullable
byte[] artworkData,
@Nullable[@PictureType](MediaMetadata.PictureType.html "annotation in com.google.android.exoplayer2")[@PictureType](MediaMetadata.PictureType.html "annotation in com.google.android.exoplayer2")[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")artworkDataType)
Sets the artwork data as a compressed byte array with an associated artworkDataType.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")maybeSetArtworkData(byte[] artworkData,[@PictureType](MediaMetadata.PictureType.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.MediaMetadata.PictureType int artworkDataType)
Sets the artwork data as a compressed byte array in the event that the associated MediaMetadata.PictureType is MediaMetadata.PICTURE_TYPE_FRONT_COVER, the existing MediaMetadata.PictureType is not MediaMetadata.PICTURE_TYPE_FRONT_COVER, or the current artworkData is not set.
Use setArtworkData(byte[], Integer) to set the artwork data without checking the MediaMetadata.PictureType.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setArtworkUri(@Nullable[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")artworkUri)
Sets the artwork Uri.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setTrackNumber(@Nullable[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")trackNumber)
Sets the track number.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setTotalTrackCount(@Nullable[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")totalTrackCount)
Sets the total number of tracks.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setFolderType(@Nullable[@FolderType](MediaMetadata.FolderType.html "annotation in com.google.android.exoplayer2")[@FolderType](MediaMetadata.FolderType.html "annotation in com.google.android.exoplayer2")[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")folderType)
Deprecated.
Use setIsBrowsable(java.lang.Boolean) to indicate if an item is a browsable folder and use setMediaType(java.lang.Integer) to indicate the type of the folder.
Sets the MediaMetadata.FolderType.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setIsBrowsable(@Nullable[Boolean](https://developer.android.com/reference/java/lang/Boolean.html "class or interface in java.lang")isBrowsable)
Sets whether the media is a browsable folder.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setIsPlayable(@Nullable[Boolean](https://developer.android.com/reference/java/lang/Boolean.html "class or interface in java.lang")isPlayable)
Sets whether the media is playable.
-
@CanIgnoreReturnValue[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setYear(@Nullable[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")year)
Deprecated.
Use setRecordingYear(Integer) instead.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setRecordingYear(@Nullable[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")recordingYear)
Sets the year of the recording date.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setRecordingMonth(@Nullable @IntRange(from=1L,to=12L)[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")recordingMonth)
Sets the month of the recording date.
Value should be between 1 and 12.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setRecordingDay(@Nullable @IntRange(from=1L,to=31L)[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")recordingDay)
Sets the day of the recording date.
Value should be between 1 and 31.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setReleaseYear(@Nullable[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")releaseYear)
Sets the year of the release date.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setReleaseMonth(@Nullable @IntRange(from=1L,to=12L)[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")releaseMonth)
Sets the month of the release date.
Value should be between 1 and 12.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setReleaseDay(@Nullable @IntRange(from=1L,to=31L)[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")releaseDay)
Sets the day of the release date.
Value should be between 1 and 31.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setWriter(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")writer)
Sets the writer.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setComposer(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")composer)
Sets the composer.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setConductor(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")conductor)
Sets the conductor.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setDiscNumber(@Nullable[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")discNumber)
Sets the disc number.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setTotalDiscCount(@Nullable[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")totalDiscCount)
Sets the total number of discs.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setGenre(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")genre)
Sets the genre.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setCompilation(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")compilation)
Sets the compilation.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setStation(@Nullable[CharSequence](https://developer.android.com/reference/java/lang/CharSequence.html "class or interface in java.lang")station)
Sets the name of the station streaming the media.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setMediaType(@Nullable[@MediaType](MediaMetadata.MediaType.html "annotation in com.google.android.exoplayer2")[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")mediaType)
Sets the MediaMetadata.MediaType.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")setExtras(@Nullable[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")extras)
Sets the extras Bundle.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")populateFromMetadata([Metadata](metadata/Metadata.html "class in com.google.android.exoplayer2.metadata")metadata)
Sets all fields supported by the entries within the Metadata.
Fields are only set if the Metadata.Entry has an implementation for Metadata.Entry.populateMediaMetadata(Builder).
In the event that multiple Metadata.Entry objects within the Metadata relate to the same MediaMetadata field, then the last one will be used.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")populateFromMetadata([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Metadata](metadata/Metadata.html "class in com.google.android.exoplayer2.metadata")> metadataList)
Sets all fields supported by the entries within the list of Metadata.
Fields are only set if the Metadata.Entry has an implementation for Metadata.Entry.populateMediaMetadata(Builder).
In the event that multiple Metadata.Entry objects within any of the Metadata relate to the same MediaMetadata field, then the last one will be used.
-
@CanIgnoreReturnValue
public[MediaMetadata.Builder](MediaMetadata.Builder.html "class in com.google.android.exoplayer2")populate(@Nullable[MediaMetadata](MediaMetadata.html "class in com.google.android.exoplayer2")mediaMetadata)
Populates all the fields from mediaMetadata, provided they are non-null.
-
public[MediaMetadata](MediaMetadata.html "class in com.google.android.exoplayer2")build()
Returns a new MediaMetadata instance with the current builder values.