Interface Loader.Callback<T extends Loader.Loadable>
-
- All Known Implementing Classes:
ChunkSampleStream,DefaultHlsPlaylistTracker,SsMediaSource
- Enclosing class:
- Loader
public static interface Loader.Callback<T extends Loader.Loadable>A callback to be notified ofLoaderevents.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonLoadCanceled(T loadable, long elapsedRealtimeMs, long loadDurationMs, boolean released)Called when a load has been canceled.voidonLoadCompleted(T loadable, long elapsedRealtimeMs, long loadDurationMs)Called when a load has completed.Loader.LoadErrorActiononLoadError(T loadable, long elapsedRealtimeMs, long loadDurationMs, IOException error, int errorCount)Called when a load encounters an error.
-
-
-
Method Detail
-
onLoadCompleted
void onLoadCompleted(T loadable, long elapsedRealtimeMs, long loadDurationMs)
Called when a load has completed.Note: There is guaranteed to be a memory barrier between
Loader.Loadable.load()exiting and this callback being called.- Parameters:
loadable- The loadable whose load has completed.elapsedRealtimeMs-SystemClock.elapsedRealtime()when the load ended.loadDurationMs- The duration in milliseconds of the load sinceLoader.startLoading(T, com.google.android.exoplayer2.upstream.Loader.Callback<T>, int)was called.
-
onLoadCanceled
void onLoadCanceled(T loadable, long elapsedRealtimeMs, long loadDurationMs, boolean released)
Called when a load has been canceled.Note: If the
Loaderhas not been released then there is guaranteed to be a memory barrier betweenLoader.Loadable.load()exiting and this callback being called. If theLoaderhas been released then this callback may be called beforeLoader.Loadable.load()exits.- Parameters:
loadable- The loadable whose load has been canceled.elapsedRealtimeMs-SystemClock.elapsedRealtime()when the load was canceled.loadDurationMs- The duration in milliseconds of the load sinceLoader.startLoading(T, com.google.android.exoplayer2.upstream.Loader.Callback<T>, int)was called up to the point at which it was canceled.released- True if the load was canceled because theLoaderwas released. False otherwise.
-
onLoadError
Loader.LoadErrorAction onLoadError(T loadable, long elapsedRealtimeMs, long loadDurationMs, IOException error, int errorCount)
Called when a load encounters an error.Note: There is guaranteed to be a memory barrier between
Loader.Loadable.load()exiting and this callback being called.- Parameters:
loadable- The loadable whose load has encountered an error.elapsedRealtimeMs-SystemClock.elapsedRealtime()when the error occurred.loadDurationMs- The duration in milliseconds of the load sinceLoader.startLoading(T, com.google.android.exoplayer2.upstream.Loader.Callback<T>, int)was called up to the point at which the error occurred.error- The load error.errorCount- The number of errors this load has encountered, including this one.- Returns:
- The desired error handling action. One of
Loader.RETRY,Loader.RETRY_RESET_ERROR_COUNT,Loader.DONT_RETRY,Loader.DONT_RETRY_FATALor a retry action created byLoader.createRetryAction(boolean, long).
-
-