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 ofMediaItems
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ListenableFuture<TrackGroupArray>
retrieveMetadata(Context context, MediaItem mediaItem)
Retrieves theTrackGroupArray
corresponding to aMediaItem
.static ListenableFuture<TrackGroupArray>
retrieveMetadata(MediaSourceFactory mediaSourceFactory, MediaItem mediaItem)
Retrieves theTrackGroupArray
corresponding to aMediaItem
.
-
-
-
Method Detail
-
retrieveMetadata
public static ListenableFuture<TrackGroupArray> retrieveMetadata(Context context, MediaItem mediaItem)
Retrieves theTrackGroupArray
corresponding to aMediaItem
.This is equivalent to using
retrieveMetadata(MediaSourceFactory, MediaItem)
with aDefaultMediaSourceFactory
and aDefaultExtractorsFactory
withMp4Extractor.FLAG_READ_MOTION_PHOTO_METADATA
andMp4Extractor.FLAG_READ_SEF_DATA
set.- Parameters:
context
- TheContext
.mediaItem
- TheMediaItem
whose metadata should be retrieved.- Returns:
- A
ListenableFuture
of the result.
-
retrieveMetadata
public static ListenableFuture<TrackGroupArray> retrieveMetadata(MediaSourceFactory mediaSourceFactory, MediaItem mediaItem)
- Parameters:
mediaSourceFactory
- mediaSourceFactory TheMediaSourceFactory
to use to read the data.mediaItem
- TheMediaItem
whose metadata should be retrieved.- Returns:
- A
ListenableFuture
of the result.
-
-