PreCacheHelper.Listener


public interface PreCacheHelper.Listener


A listener for PreCacheHelper events.

The methods are called from the thread where the PreCacheHelper instance is created.

Summary

Public methods

default void

Called from PreCacheHelper when error occurs during the download.

default void
onPreCacheProgress(
    MediaItem mediaItem,
    long contentLength,
    long bytesDownloaded,
    float percentageDownloaded
)

Called from PreCacheHelper when progress is made during a download operation.

default void
onPrepareError(MediaItem mediaItem, IOException error)

Called from PreCacheHelper when error occurs during the preparation.

default void
onPrepared(MediaItem originalMediaItem, MediaItem updatedMediaItem)

Called from PreCacheHelper when the MediaItem is prepared.

Public methods

onDownloadError

default void onDownloadError(MediaItem mediaItem, IOException error)

Called from PreCacheHelper when error occurs during the download.

Parameters
MediaItem mediaItem

The MediaItem passed to create the PreCacheHelper.

IOException error

The error.

onPreCacheProgress

default void onPreCacheProgress(
    MediaItem mediaItem,
    long contentLength,
    long bytesDownloaded,
    float percentageDownloaded
)

Called from PreCacheHelper when progress is made during a download operation.

Parameters
MediaItem mediaItem

The MediaItem passed to create the PreCacheHelper.

long contentLength

The length of the content to be cached in bytes, or LENGTH_UNSET if unknown.

long bytesDownloaded

The number of bytes that have been downloaded.

float percentageDownloaded

The percentage of the content that has been downloaded, or PERCENTAGE_UNSET.

onPrepareError

default void onPrepareError(MediaItem mediaItem, IOException error)

Called from PreCacheHelper when error occurs during the preparation.

Parameters
MediaItem mediaItem

The MediaItem passed to create the PreCacheHelper.

IOException error

The error.

onPrepared

default void onPrepared(MediaItem originalMediaItem, MediaItem updatedMediaItem)

Called from PreCacheHelper when the MediaItem is prepared.

Parameters
MediaItem originalMediaItem

The original MediaItem passed to create the .

MediaItem updatedMediaItem

The updated MediaItem after preparation that should be passed to the ExoPlayer for making playback read from the cached data.