Package com.google.android.exoplayer2

## Class MetadataRetriever

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

-     public final class MetadataRetriever
      extends Object

  Retrieves the static metadata of `MediaItems`.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static ListenableFuture<TrackGroupArray>` | `retrieveMetadata​(Context context, MediaItem mediaItem)` | Retrieves the `TrackGroupArray` corresponding to a `MediaItem`.
    `static ListenableFuture<TrackGroupArray>` | `retrieveMetadata​(MediaSource.Factory mediaSourceFactory, MediaItem mediaItem)` | Retrieves the `TrackGroupArray` corresponding to a `MediaItem`.

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

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

- - ### Method Detail

    - #### retrieveMetadata

          public static ListenableFuture<TrackGroupArray> retrieveMetadata​(Context context,
                                                                           MediaItem mediaItem)

      Retrieves the `TrackGroupArray` corresponding to a `MediaItem`.

      This is equivalent to using `retrieveMetadata(MediaSource.Factory, MediaItem)` with a `DefaultMediaSourceFactory` and a `DefaultExtractorsFactory` with `Mp4Extractor.FLAG_READ_MOTION_PHOTO_METADATA` and `Mp4Extractor.FLAG_READ_SEF_DATA` set.

      Parameters:
        `context` - The `Context`.
        `mediaItem` - The `MediaItem` whose metadata should be retrieved.
      Returns:
        A `ListenableFuture` of the result.

    - #### retrieveMetadata

          public static ListenableFuture<TrackGroupArray> retrieveMetadata​(MediaSource.Factory mediaSourceFactory,
                                                                           MediaItem mediaItem)

      Retrieves the `TrackGroupArray` corresponding to a `MediaItem`.

      This method is thread-safe.

      Parameters:
        `mediaSourceFactory` - mediaSourceFactory The `MediaSource.Factory` to use to read the data.
        `mediaItem` - The `MediaItem` whose metadata should be retrieved.
      Returns:
        A `ListenableFuture` of the result.