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!,
    bufferedDurationUs: Long
)

Called from PreloadMediaSource when it requests to continue loading.

Unit

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

Unit

Called from PreloadMediaSource when an error occurs.

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!,
    bufferedDurationUs: 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.

bufferedDurationUs: Long

An estimate of the duration from the start position for which data is buffered, in microseconds.

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.

onPreloadError

fun onPreloadError(error: PreloadException!, mediaSource: PreloadMediaSource!): Unit

Called from PreloadMediaSource when an error occurs.

Parameters
error: PreloadException!

The error.

mediaSource: PreloadMediaSource!

The PreloadMediaSource that has the error occur.

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.