PreloadMediaSource.PreloadControl


interface PreloadMediaSource.PreloadControl


Controls preloading of PreloadMediaSource.

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

Summary

Public functions

Boolean
onContinueLoadingRequested(
    mediaSource: PreloadMediaSource!,
    bufferedPositionUs: Long
)

Called from PreloadMediaSource when it requests to continue loading.

Unit

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

Boolean

Called from PreloadMediaSource when it has completed preparation.

Boolean

Called from PreloadMediaSource when it has tracks selected.

Unit

Called from PreloadMediaSource when the player starts using this source.

Public functions

onContinueLoadingRequested

fun onContinueLoadingRequested(
    mediaSource: PreloadMediaSource!,
    bufferedPositionUs: Long
): Boolean

Called from PreloadMediaSource when it requests to continue loading.

If fully loaded, then onLoadedToTheEndOfSource will be called instead.

Parameters
mediaSource: PreloadMediaSource!

The PreloadMediaSource that requests to continue loading.

bufferedPositionUs: Long

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

onLoadedToTheEndOfSource

fun onLoadedToTheEndOfSource(mediaSource: PreloadMediaSource!): Unit

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

The default implementation is a no-op.

Parameters
mediaSource: PreloadMediaSource!

The PreloadMediaSource that has loaded to the end of source.

onSourcePrepared

fun onSourcePrepared(mediaSource: PreloadMediaSource!): Boolean

Called from PreloadMediaSource when it has completed preparation.

Parameters
mediaSource: PreloadMediaSource!

The PreloadMediaSource that has completed preparation.

Returns
Boolean

True if the mediaSource should continue preloading, false otherwise.

onTracksSelected

fun onTracksSelected(mediaSource: PreloadMediaSource!): Boolean

Called from PreloadMediaSource when it has tracks selected.

Parameters
mediaSource: PreloadMediaSource!

The PreloadMediaSource that has tracks selected.

Returns
Boolean

True if the mediaSource should continue preloading, false otherwise.

onUsedByPlayer

fun onUsedByPlayer(mediaSource: PreloadMediaSource!): Unit

Called from PreloadMediaSource when the player starts using this source.

Parameters
mediaSource: PreloadMediaSource!

The PreloadMediaSource that the player starts using.