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.

Boolean

Called from PreloadMediaSource when it is prepared.

Boolean

Called from PreloadMediaSource when the Timeline is refreshed.

Public functions

onContinueLoadingRequested

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

Called from PreloadMediaSource when it requests to continue loading.

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

onPrepared

fun onPrepared(mediaSource: PreloadMediaSource!): Boolean

Called from PreloadMediaSource when it is prepared.

Parameters
mediaSource: PreloadMediaSource!

The PreloadMediaSource it is prepared.

Returns
Boolean

True if the mediaSource should continue preloading, false otherwise.

onTimelineRefreshed

fun onTimelineRefreshed(mediaSource: PreloadMediaSource!): Boolean

Called from PreloadMediaSource when the Timeline is refreshed.

Parameters
mediaSource: PreloadMediaSource!

The PreloadMediaSource that has its Timeline refreshed.

Returns
Boolean

True if the mediaSource should continue preloading, false otherwise.