public class CompositeSequenceableLoader extends Object implements SequenceableLoader
SequenceableLoader
that encapsulates multiple other SequenceableLoader
s.SequenceableLoader.Callback<T extends SequenceableLoader>
Modifier and Type | Field and Description |
---|---|
protected SequenceableLoader[] |
loaders |
Constructor and Description |
---|
CompositeSequenceableLoader(SequenceableLoader[] loaders) |
Modifier and Type | Method and Description |
---|---|
boolean |
continueLoading(long positionUs)
Attempts to continue loading.
|
long |
getBufferedPositionUs()
Returns an estimate of the position up to which data is buffered.
|
long |
getNextLoadPositionUs()
Returns the next load time, or
C.TIME_END_OF_SOURCE if loading has finished. |
void |
reevaluateBuffer(long positionUs)
Re-evaluates the buffer given the playback position.
|
protected final SequenceableLoader[] loaders
public CompositeSequenceableLoader(SequenceableLoader[] loaders)
public final long getBufferedPositionUs()
SequenceableLoader
getBufferedPositionUs
in interface SequenceableLoader
C.TIME_END_OF_SOURCE
if the data is fully buffered.public final long getNextLoadPositionUs()
SequenceableLoader
C.TIME_END_OF_SOURCE
if loading has finished.getNextLoadPositionUs
in interface SequenceableLoader
public final void reevaluateBuffer(long positionUs)
SequenceableLoader
Re-evaluation may discard buffered media so that it can be re-buffered in a different quality.
reevaluateBuffer
in interface SequenceableLoader
positionUs
- The current playback position in microseconds. If playback of this period has
not yet started, the value will be the starting position in this period minus the duration
of any media in previous periods still to be played.public boolean continueLoading(long positionUs)
SequenceableLoader
continueLoading
in interface SequenceableLoader
positionUs
- The current playback position in microseconds. If playback of the period to
which this loader belongs has not yet started, the value will be the starting position
in the period minus the duration of any media in previous periods still to be played.SequenceableLoader.getNextLoadPositionUs()
will return
a different value than prior to the call. False otherwise.