Loader.Loadablepublic final class FakeMediaChunk extends MediaChunk
MediaChunk.dataSource, dataSpec, endTimeUs, loadTaskId, startTimeUs, trackFormat, trackSelectionData, trackSelectionReason, typechunkIndex| Constructor | Description |
|---|---|
FakeMediaChunk(Format trackFormat,
long startTimeUs,
long endTimeUs) |
Creates a fake media chunk.
|
FakeMediaChunk(Format trackFormat,
long startTimeUs,
long endTimeUs,
int selectionReason) |
Creates a fake media chunk.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
cancelLoad() |
Cancels the load.
|
boolean |
isLoadCompleted() |
Returns whether the chunk has been fully loaded.
|
void |
load() |
Performs the load, returning on completion or cancellation.
|
bytesLoaded, getDurationUs, getResponseHeaders, getUrigetNextChunkIndexpublic FakeMediaChunk(Format trackFormat, long startTimeUs, long endTimeUs)
trackFormat - The Format.startTimeUs - The start time of the media, in microseconds.endTimeUs - The end time of the media, in microseconds.public FakeMediaChunk(Format trackFormat, long startTimeUs, long endTimeUs, int selectionReason)
trackFormat - The Format.startTimeUs - The start time of the media, in microseconds.endTimeUs - The end time of the media, in microseconds.selectionReason - The reason for selecting this format.public void cancelLoad()
Loader.LoadableLoadable implementations should ensure that a currently executing Loader.Loadable.load() call
will exit reasonably quickly after this method is called. The Loader.Loadable.load() call may exit
either by returning or by throwing an IOException.
If there is a currently executing Loader.Loadable.load() call, then the thread on which that call
is being made will be interrupted immediately after the call to this method. Hence
implementations do not need to (and should not attempt to) interrupt the loading thread
themselves.
Although the loading thread will be interrupted, Loadable implementations should not use
the interrupted status of the loading thread in Loader.Loadable.load() to determine whether the load
has been canceled. This approach is not robust [Internal ref: b/79223737]. Instead,
implementations should use their own flag to signal cancelation (for example, using AtomicBoolean).
public void load()
Loader.Loadablepublic boolean isLoadCompleted()
MediaChunkisLoadCompleted in class MediaChunk