Class CompositeSequenceableLoader
- java.lang.Object
-
- com.google.android.exoplayer2.source.CompositeSequenceableLoader
-
- All Implemented Interfaces:
SequenceableLoader
public class CompositeSequenceableLoader extends Object implements SequenceableLoader
ASequenceableLoaderthat encapsulates multiple otherSequenceableLoaders.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.source.SequenceableLoader
SequenceableLoader.Callback<T extends SequenceableLoader>
-
-
Field Summary
Fields Modifier and Type Field Description protected SequenceableLoader[]loaders
-
Constructor Summary
Constructors Constructor Description CompositeSequenceableLoader(SequenceableLoader[] loaders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontinueLoading(long positionUs)Attempts to continue loading.longgetBufferedPositionUs()Returns an estimate of the position up to which data is buffered.longgetNextLoadPositionUs()Returns the next load time, orC.TIME_END_OF_SOURCEif loading has finished.booleanisLoading()Returns whether the loader is currently loading.voidreevaluateBuffer(long positionUs)Re-evaluates the buffer given the playback position.
-
-
-
Field Detail
-
loaders
protected final SequenceableLoader[] loaders
-
-
Constructor Detail
-
CompositeSequenceableLoader
public CompositeSequenceableLoader(SequenceableLoader[] loaders)
-
-
Method Detail
-
getBufferedPositionUs
public final long getBufferedPositionUs()
Description copied from interface:SequenceableLoaderReturns an estimate of the position up to which data is buffered.- Specified by:
getBufferedPositionUsin interfaceSequenceableLoader- Returns:
- An estimate of the absolute position in microseconds up to which data is buffered, or
C.TIME_END_OF_SOURCEif the data is fully buffered.
-
getNextLoadPositionUs
public final long getNextLoadPositionUs()
Description copied from interface:SequenceableLoaderReturns the next load time, orC.TIME_END_OF_SOURCEif loading has finished.- Specified by:
getNextLoadPositionUsin interfaceSequenceableLoader
-
reevaluateBuffer
public final void reevaluateBuffer(long positionUs)
Description copied from interface:SequenceableLoaderRe-evaluates the buffer given the playback position.Re-evaluation may discard buffered media or cancel ongoing loads so that media can be re-buffered in a different quality.
- Specified by:
reevaluateBufferin interfaceSequenceableLoader- Parameters:
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.
-
continueLoading
public boolean continueLoading(long positionUs)
Description copied from interface:SequenceableLoaderAttempts to continue loading.- Specified by:
continueLoadingin interfaceSequenceableLoader- Parameters:
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.- Returns:
- True if progress was made, meaning that
SequenceableLoader.getNextLoadPositionUs()will return a different value than prior to the call. False otherwise.
-
isLoading
public boolean isLoading()
Description copied from interface:SequenceableLoaderReturns whether the loader is currently loading.- Specified by:
isLoadingin interfaceSequenceableLoader
-
-