MetadataRetriever
@UnstableApi
public final class MetadataRetriever implements AutoCloseable
Summary
Nested types |
|---|
public final class MetadataRetriever.BuilderBuilder for |
Constants |
|
|---|---|
static final int |
The default number of maximum parallel retrievals. |
Public methods |
|
|---|---|
void |
|
ListenableFuture<Long> |
Asynchronously retrieves the duration for the |
static ListenableFuture<TrackGroupArray> |
This method is deprecated. Use |
static ListenableFuture<TrackGroupArray> |
This method is deprecated. Use |
ListenableFuture<Timeline> |
|
ListenableFuture<TrackGroupArray> |
Asynchronously retrieves the |
static void |
Sets the maximum number of metadata retrievals run in parallel. |
Constants
DEFAULT_MAXIMUM_PARALLEL_RETRIEVALS
public static final int DEFAULT_MAXIMUM_PARALLEL_RETRIEVALS = 5
The default number of maximum parallel retrievals.
Public methods
retrieveDurationUs
public ListenableFuture<Long>retrieveDurationUs()
Asynchronously retrieves the duration for the MediaItem.
| Returns | |
|---|---|
ListenableFuture<Long> |
A |
retrieveMetadata
public static ListenableFuture<TrackGroupArray>retrieveMetadata(Context context, MediaItem mediaItem)
retrieveMetadata
public static ListenableFuture<TrackGroupArray>retrieveMetadata(
MediaSource.Factory mediaSourceFactory,
MediaItem mediaItem
)
retrieveTimeline
public ListenableFuture<Timeline>retrieveTimeline()
Asynchronously retrieves the Timeline for the MediaItem.
| Returns | |
|---|---|
ListenableFuture<Timeline> |
A |
retrieveTrackGroups
public ListenableFuture<TrackGroupArray>retrieveTrackGroups()
Asynchronously retrieves the TrackGroupArray for the MediaItem.
| Returns | |
|---|---|
ListenableFuture<TrackGroupArray> |
A |
setMaximumParallelRetrievals
public static void setMaximumParallelRetrievals(int maximumParallelRetrievals)Sets the maximum number of metadata retrievals run in parallel.
The default is DEFAULT_MAXIMUM_PARALLEL_RETRIEVALS.
| Parameters | |
|---|---|
int maximumParallelRetrievals |
The maximum number of parallel retrievals. |