PreloadMediaSource.PreloadControl


public interface PreloadMediaSource.PreloadControl


Controls preloading of PreloadMediaSource.

The methods are called on the Looper that is passed when constructing the .

Summary

Public methods

abstract boolean
onContinueLoadingRequested(
    PreloadMediaSource mediaSource,
    long bufferedPositionUs
)

Called from PreloadMediaSource when it requests to continue loading.

default void

Called from PreloadMediaSource when it has loaded to the end of source.

abstract boolean

Called from PreloadMediaSource when it has completed preparation.

abstract boolean

Called from PreloadMediaSource when it has tracks selected.

abstract void

Called from PreloadMediaSource when the player starts using this source.

Public methods

onContinueLoadingRequested

abstract boolean onContinueLoadingRequested(
    PreloadMediaSource mediaSource,
    long bufferedPositionUs
)

Called from PreloadMediaSource when it requests to continue loading.

If fully loaded, then onLoadedToTheEndOfSource will be called instead.

Parameters
PreloadMediaSource mediaSource

The PreloadMediaSource that requests to continue loading.

long bufferedPositionUs

An estimate of the absolute position in microseconds up to which data is buffered.

onLoadedToTheEndOfSource

default void onLoadedToTheEndOfSource(PreloadMediaSource mediaSource)

Called from PreloadMediaSource when it has loaded to the end of source.

The default implementation is a no-op.

Parameters
PreloadMediaSource mediaSource

The PreloadMediaSource that has loaded to the end of source.

onSourcePrepared

abstract boolean onSourcePrepared(PreloadMediaSource mediaSource)

Called from PreloadMediaSource when it has completed preparation.

Parameters
PreloadMediaSource mediaSource

The PreloadMediaSource that has completed preparation.

Returns
boolean

True if the mediaSource should continue preloading, false otherwise.

onTracksSelected

abstract boolean onTracksSelected(PreloadMediaSource mediaSource)

Called from PreloadMediaSource when it has tracks selected.

Parameters
PreloadMediaSource mediaSource

The PreloadMediaSource that has tracks selected.

Returns
boolean

True if the mediaSource should continue preloading, false otherwise.

onUsedByPlayer

abstract void onUsedByPlayer(PreloadMediaSource mediaSource)

Called from PreloadMediaSource when the player starts using this source.

Parameters
PreloadMediaSource mediaSource

The PreloadMediaSource that the player starts using.