Stay organized with collections Save and categorize content based on your preferences.

CompositeSequenceableLoader

@UnstableApi
public class CompositeSequenceableLoader implements SequenceableLoader


A SequenceableLoader that encapsulates multiple other SequenceableLoaders.

Summary

Protected fields

final SequenceableLoader[]

Public constructors

CompositeSequenceableLoader(SequenceableLoader[] loaders)

Public methods

boolean
continueLoading(long positionUs)

Attempts to continue loading.

final long

Returns an estimate of the position up to which data is buffered.

final long

Returns the next load time, or TIME_END_OF_SOURCE if loading has finished.

boolean

Returns whether the loader is currently loading.

final void
reevaluateBuffer(long positionUs)

Re-evaluates the buffer given the playback position.

Protected fields

loaders

protected final SequenceableLoader[] loaders

Public constructors

CompositeSequenceableLoader

public CompositeSequenceableLoader(SequenceableLoader[] loaders)

Public methods

continueLoading

public boolean continueLoading(long positionUs)

Attempts to continue loading.

Parameters
long 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
boolean

True if progress was made, meaning that getNextLoadPositionUs will return a different value than prior to the call. False otherwise.

getBufferedPositionUs

public final long getBufferedPositionUs()

Returns an estimate of the position up to which data is buffered.

Returns
long

An estimate of the absolute position in microseconds up to which data is buffered, or TIME_END_OF_SOURCE if the data is fully buffered.

getNextLoadPositionUs

public final long getNextLoadPositionUs()

Returns the next load time, or TIME_END_OF_SOURCE if loading has finished.

isLoading

public boolean isLoading()

Returns whether the loader is currently loading.

reevaluateBuffer

public final void reevaluateBuffer(long positionUs)

Re-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.

Parameters
long 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.