Package com.google.android.exoplayer2

## Class MediaMetadata

- java.lang.Object
- - com.google.android.exoplayer2.MediaMetadata

- All Implemented Interfaces:
    `Bundleable`

      public final class MediaMetadata
      extends Object
      implements Bundleable

  Metadata of a `MediaItem`, playlist, or a combination of multiple sources of `Metadata`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `MediaMetadata.Builder` | A builder for `MediaMetadata` instances.
    `static interface` | `MediaMetadata.FolderType` | The folder type of the media item.
    `static interface` | `MediaMetadata.PictureType` | The picture type of the artwork.

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable

      `Bundleable.Creator<T extends Bundleable>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `CharSequence` | `albumArtist` | Optional album artist.
    `CharSequence` | `albumTitle` | Optional album title.
    `CharSequence` | `artist` | Optional artist.
    `byte[]` | `artworkData` | Optional artwork data as a compressed byte array.
    `Integer` | `artworkDataType` | Optional `MediaMetadata.PictureType` of the artwork data.
    `Uri` | `artworkUri` | Optional artwork `Uri`.
    `CharSequence` | `compilation` | Optional compilation.
    `CharSequence` | `composer` | Optional composer.
    `CharSequence` | `conductor` | Optional conductor.
    `static Bundleable.Creator<MediaMetadata>` | `CREATOR` | Object that can restore `MediaMetadata` from a `Bundle`.
    `CharSequence` | `description` | Optional description.
    `Integer` | `discNumber` | Optional disc number.
    `CharSequence` | `displayTitle` | Optional display title.
    `static MediaMetadata` | `EMPTY` | Empty `MediaMetadata`.
    `Bundle` | `extras` | Optional extras `Bundle`.
    `static int` | `FOLDER_TYPE_ALBUMS` | Type for a folder containing media categorized by album.
    `static int` | `FOLDER_TYPE_ARTISTS` | Type for a folder containing media categorized by artist.
    `static int` | `FOLDER_TYPE_GENRES` | Type for a folder containing media categorized by genre.
    `static int` | `FOLDER_TYPE_MIXED` | Type for a folder containing media of mixed types.
    `static int` | `FOLDER_TYPE_NONE` | Type for an item that is not a folder.
    `static int` | `FOLDER_TYPE_PLAYLISTS` | Type for a folder containing a playlist.
    `static int` | `FOLDER_TYPE_TITLES` | Type for a folder containing only playable media.
    `static int` | `FOLDER_TYPE_YEARS` | Type for a folder containing media categorized by year.
    `Integer` | `folderType` | Optional `MediaMetadata.FolderType`.
    `CharSequence` | `genre` | Optional genre.
    `Boolean` | `isPlayable` | Optional boolean for media playability.
    `Uri` | `mediaUri` | Optional media `Uri`.
    `Rating` | `overallRating` | Optional overall `Rating`.
    `static int` | `PICTURE_TYPE_A_BRIGHT_COLORED_FISH` |
    `static int` | `PICTURE_TYPE_ARTIST_PERFORMER` |
    `static int` | `PICTURE_TYPE_BACK_COVER` |
    `static int` | `PICTURE_TYPE_BAND_ARTIST_LOGO` |
    `static int` | `PICTURE_TYPE_BAND_ORCHESTRA` |
    `static int` | `PICTURE_TYPE_COMPOSER` |
    `static int` | `PICTURE_TYPE_CONDUCTOR` |
    `static int` | `PICTURE_TYPE_DURING_PERFORMANCE` |
    `static int` | `PICTURE_TYPE_DURING_RECORDING` |
    `static int` | `PICTURE_TYPE_FILE_ICON` |
    `static int` | `PICTURE_TYPE_FILE_ICON_OTHER` |
    `static int` | `PICTURE_TYPE_FRONT_COVER` |
    `static int` | `PICTURE_TYPE_ILLUSTRATION` |
    `static int` | `PICTURE_TYPE_LEAD_ARTIST_PERFORMER` |
    `static int` | `PICTURE_TYPE_LEAFLET_PAGE` |
    `static int` | `PICTURE_TYPE_LYRICIST` |
    `static int` | `PICTURE_TYPE_MEDIA` |
    `static int` | `PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE` |
    `static int` | `PICTURE_TYPE_OTHER` |
    `static int` | `PICTURE_TYPE_PUBLISHER_STUDIO_LOGO` |
    `static int` | `PICTURE_TYPE_RECORDING_LOCATION` |
    `Integer` | `recordingDay` | Optional day of the recording date.
    `Integer` | `recordingMonth` | Optional month of the recording date.
    `Integer` | `recordingYear` | Optional year of the recording date.
    `Integer` | `releaseDay` | Optional day of the release date.
    `Integer` | `releaseMonth` | Optional month of the release date.
    `Integer` | `releaseYear` | Optional year of the release date.
    `CharSequence` | `subtitle` | Optional subtitle.
    `CharSequence` | `title` | Optional title.
    `Integer` | `totalDiscCount` | Optional total number of discs.
    `Integer` | `totalTrackCount` | Optional total number of tracks.
    `Integer` | `trackNumber` | Optional track number.
    `Rating` | `userRating` | Optional user `Rating`.
    `CharSequence` | `writer` | Optional writer.
    `Integer` | `year` | Deprecated. Use `recordingYear` instead.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `MediaMetadata.Builder` | `buildUpon()` | Returns a new `MediaMetadata.Builder` instance with the current `MediaMetadata` fields.
    `boolean` | `equals​(Object obj)` |
    `int` | `hashCode()` |
    `Bundle` | `toBundle()` | Returns a `Bundle` representing the information stored in this object.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### FOLDER_TYPE_NONE

          public static final int FOLDER_TYPE_NONE

      Type for an item that is not a folder.
      See Also:
        Constant Field Values

    - #### FOLDER_TYPE_MIXED

          public static final int FOLDER_TYPE_MIXED

      Type for a folder containing media of mixed types.
      See Also:
        Constant Field Values

    - #### FOLDER_TYPE_TITLES

          public static final int FOLDER_TYPE_TITLES

      Type for a folder containing only playable media.
      See Also:
        Constant Field Values

    - #### FOLDER_TYPE_ALBUMS

          public static final int FOLDER_TYPE_ALBUMS

      Type for a folder containing media categorized by album.
      See Also:
        Constant Field Values

    - #### FOLDER_TYPE_ARTISTS

          public static final int FOLDER_TYPE_ARTISTS

      Type for a folder containing media categorized by artist.
      See Also:
        Constant Field Values

    - #### FOLDER_TYPE_GENRES

          public static final int FOLDER_TYPE_GENRES

      Type for a folder containing media categorized by genre.
      See Also:
        Constant Field Values

    - #### FOLDER_TYPE_PLAYLISTS

          public static final int FOLDER_TYPE_PLAYLISTS

      Type for a folder containing a playlist.
      See Also:
        Constant Field Values

    - #### FOLDER_TYPE_YEARS

          public static final int FOLDER_TYPE_YEARS

      Type for a folder containing media categorized by year.
      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_OTHER

          public static final int PICTURE_TYPE_OTHER

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_FILE_ICON

          public static final int PICTURE_TYPE_FILE_ICON

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_FILE_ICON_OTHER

          public static final int PICTURE_TYPE_FILE_ICON_OTHER

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_FRONT_COVER

          public static final int PICTURE_TYPE_FRONT_COVER

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_BACK_COVER

          public static final int PICTURE_TYPE_BACK_COVER

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_LEAFLET_PAGE

          public static final int PICTURE_TYPE_LEAFLET_PAGE

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_MEDIA

          public static final int PICTURE_TYPE_MEDIA

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_LEAD_ARTIST_PERFORMER

          public static final int PICTURE_TYPE_LEAD_ARTIST_PERFORMER

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_ARTIST_PERFORMER

          public static final int PICTURE_TYPE_ARTIST_PERFORMER

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_CONDUCTOR

          public static final int PICTURE_TYPE_CONDUCTOR

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_BAND_ORCHESTRA

          public static final int PICTURE_TYPE_BAND_ORCHESTRA

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_COMPOSER

          public static final int PICTURE_TYPE_COMPOSER

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_LYRICIST

          public static final int PICTURE_TYPE_LYRICIST

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_RECORDING_LOCATION

          public static final int PICTURE_TYPE_RECORDING_LOCATION

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_DURING_RECORDING

          public static final int PICTURE_TYPE_DURING_RECORDING

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_DURING_PERFORMANCE

          public static final int PICTURE_TYPE_DURING_PERFORMANCE

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE

          public static final int PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_A_BRIGHT_COLORED_FISH

          public static final int PICTURE_TYPE_A_BRIGHT_COLORED_FISH

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_ILLUSTRATION

          public static final int PICTURE_TYPE_ILLUSTRATION

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_BAND_ARTIST_LOGO

          public static final int PICTURE_TYPE_BAND_ARTIST_LOGO

      See Also:
        Constant Field Values

    - #### PICTURE_TYPE_PUBLISHER_STUDIO_LOGO

          public static final int PICTURE_TYPE_PUBLISHER_STUDIO_LOGO

      See Also:
        Constant Field Values

    - #### EMPTY

          public static final MediaMetadata EMPTY

      Empty `MediaMetadata`.

    - #### title

          @Nullable
          public final CharSequence title

      Optional title.

    - #### artist

          @Nullable
          public final CharSequence artist

      Optional artist.

    - #### albumTitle

          @Nullable
          public final CharSequence albumTitle

      Optional album title.

    - #### albumArtist

          @Nullable
          public final CharSequence albumArtist

      Optional album artist.

    - #### displayTitle

          @Nullable
          public final CharSequence displayTitle

      Optional display title.

    - #### subtitle

          @Nullable
          public final CharSequence subtitle

      Optional subtitle.

      This is the secondary title of the media, unrelated to closed captions.

    - #### description

          @Nullable
          public final CharSequence description

      Optional description.

    - #### mediaUri

          @Nullable
          public final Uri mediaUri

      Optional media `Uri`.

    - #### userRating

          @Nullable
          public final Rating userRating

      Optional user `Rating`.

    - #### overallRating

          @Nullable
          public final Rating overallRating

      Optional overall `Rating`.

    - #### artworkData

          @Nullable
          public final byte[] artworkData

      Optional artwork data as a compressed byte array.

    - #### artworkDataType

          @Nullable
          @PictureType
          public final Integer artworkDataType

      Optional `MediaMetadata.PictureType` of the artwork data.

    - #### artworkUri

          @Nullable
          public final Uri artworkUri

      Optional artwork `Uri`.

    - #### trackNumber

          @Nullable
          public final Integer trackNumber

      Optional track number.

    - #### totalTrackCount

          @Nullable
          public final Integer totalTrackCount

      Optional total number of tracks.

    - #### folderType

          @Nullable
          @FolderType
          public final Integer folderType

      Optional `MediaMetadata.FolderType`.

    - #### isPlayable

          @Nullable
          public final Boolean isPlayable

      Optional boolean for media playability.

    - #### year

          @Deprecated
          @Nullable
          public final Integer year

      Deprecated.
      Use `recordingYear` instead.

    - #### recordingYear

          @Nullable
          public final Integer recordingYear

      Optional year of the recording date.

    - #### recordingMonth

          @Nullable
          public final Integer recordingMonth

      Optional month of the recording date.

      Note that there is no guarantee that the month and day are a valid combination.

    - #### recordingDay

          @Nullable
          public final Integer recordingDay

      Optional day of the recording date.

      Note that there is no guarantee that the month and day are a valid combination.

    - #### releaseYear

          @Nullable
          public final Integer releaseYear

      Optional year of the release date.

    - #### releaseMonth

          @Nullable
          public final Integer releaseMonth

      Optional month of the release date.

      Note that there is no guarantee that the month and day are a valid combination.

    - #### releaseDay

          @Nullable
          public final Integer releaseDay

      Optional day of the release date.

      Note that there is no guarantee that the month and day are a valid combination.

    - #### writer

          @Nullable
          public final CharSequence writer

      Optional writer.

    - #### composer

          @Nullable
          public final CharSequence composer

      Optional composer.

    - #### conductor

          @Nullable
          public final CharSequence conductor

      Optional conductor.

    - #### discNumber

          @Nullable
          public final Integer discNumber

      Optional disc number.

    - #### totalDiscCount

          @Nullable
          public final Integer totalDiscCount

      Optional total number of discs.

    - #### genre

          @Nullable
          public final CharSequence genre

      Optional genre.

    - #### compilation

          @Nullable
          public final CharSequence compilation

      Optional compilation.

    - #### extras

          @Nullable
          public final Bundle extras

      Optional extras `Bundle`.

      Given the complexities of checking the equality of two `Bundle`s, this is not considered in the `equals(Object)` or `hashCode()`.

    - #### CREATOR

          public static final Bundleable.Creator<MediaMetadata> CREATOR

      Object that can restore `MediaMetadata` from a `Bundle`.

  - ### Method Detail

    - #### buildUpon

          public MediaMetadata.Builder buildUpon()

      Returns a new `MediaMetadata.Builder` instance with the current `MediaMetadata` fields.

    - #### equals

          public boolean equals​(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toBundle

          public Bundle toBundle()

      Description copied from interface: `Bundleable`
      Returns a `Bundle` representing the information stored in this object.
      Specified by:
        `toBundle` in interface `Bundleable`