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.

abstract boolean

Called from PreloadMediaSource when it is prepared.

abstract boolean

Called from PreloadMediaSource when the Timeline is refreshed.

Public methods

onContinueLoadingRequested

abstract boolean onContinueLoadingRequested(
    PreloadMediaSource mediaSource,
    long bufferedPositionUs
)

Called from PreloadMediaSource when it requests to continue loading.

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, or TIME_END_OF_SOURCE if the track is fully buffered.

onPrepared

abstract boolean onPrepared(PreloadMediaSource mediaSource)

Called from PreloadMediaSource when it is prepared.

Parameters
PreloadMediaSource mediaSource

The PreloadMediaSource it is prepared.

Returns
boolean

True if the mediaSource should continue preloading, false otherwise.

onTimelineRefreshed

abstract boolean onTimelineRefreshed(PreloadMediaSource mediaSource)

Called from PreloadMediaSource when the Timeline is refreshed.

Parameters
PreloadMediaSource mediaSource

The PreloadMediaSource that has its Timeline refreshed.

Returns
boolean

True if the mediaSource should continue preloading, false otherwise.