Loader.Callback
interface Loader.Callback<T : Loader.Loadable?>
ChunkSampleStream |
A |
DefaultHlsPlaylistTracker |
Default implementation for |
SsMediaSource |
A SmoothStreaming |
A callback to be notified of Loader events.
Summary
Public functions |
|
|---|---|
Unit |
onLoadCanceled(Called when a load has been canceled. |
Unit |
onLoadCompleted(loadable: T!, elapsedRealtimeMs: Long, loadDurationMs: Long)Called when a load has completed. |
Loader.LoadErrorAction! |
onLoadError(Called when a load encounters an error. |
Unit |
onLoadStarted(Called when a load has started for the first time or through a retry. |
Public functions
onLoadCanceled
fun onLoadCanceled(
loadable: T!,
elapsedRealtimeMs: Long,
loadDurationMs: Long,
released: Boolean
): Unit
Called when a load has been canceled.
Note: If the Loader has not been released then there is guaranteed to be a memory barrier between load exiting and this callback being called. If the Loader has been released then this callback may be called before load exits.
| Parameters | |
|---|---|
loadable: T! |
The loadable whose load has been canceled. |
elapsedRealtimeMs: Long |
|
loadDurationMs: Long |
The duration in milliseconds of the load since |
released: Boolean |
True if the load was canceled because the |
onLoadCompleted
fun onLoadCompleted(loadable: T!, elapsedRealtimeMs: Long, loadDurationMs: Long): Unit
Called when a load has completed.
Note: There is guaranteed to be a memory barrier between load exiting and this callback being called.
| Parameters | |
|---|---|
loadable: T! |
The loadable whose load has completed. |
elapsedRealtimeMs: Long |
|
loadDurationMs: Long |
The duration in milliseconds of the load since |
onLoadError
fun onLoadError(
loadable: T!,
elapsedRealtimeMs: Long,
loadDurationMs: Long,
error: IOException!,
errorCount: Int
): Loader.LoadErrorAction!
Called when a load encounters an error.
Note: There is guaranteed to be a memory barrier between load exiting and this callback being called.
| Parameters | |
|---|---|
loadable: T! |
The loadable whose load has encountered an error. |
elapsedRealtimeMs: Long |
|
loadDurationMs: Long |
The duration in milliseconds of the load since |
error: IOException! |
The load error. |
errorCount: Int |
The number of errors this load has encountered, including this one. |
| Returns | |
|---|---|
Loader.LoadErrorAction! |
The desired error handling action. One of |
onLoadStarted
fun onLoadStarted(
loadable: T!,
elapsedRealtimeMs: Long,
loadDurationMs: Long,
retryCount: Int
): Unit
Called when a load has started for the first time or through a retry.
This is called for the first time with retryCount == 0 just before the load is started.
| Parameters | |
|---|---|
loadable: T! |
The loadable whose load has started. |
elapsedRealtimeMs: Long |
|
loadDurationMs: Long |
The duration in milliseconds of the load since |
retryCount: Int |
The number of failed attempts since |