docs/doc/reference/com/google/android/exoplayer2/upstream/LoadErrorHandlingPolicy.html
Package com.google.android.exoplayer2.upstream
DefaultLoadErrorHandlingPolicy[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceLoadErrorHandlingPolicy
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
A policy that defines how load errors are handled.
Some loaders are able to choose between a number of alternate resources. Such loaders will call getFallbackSelectionFor(FallbackOptions, LoadErrorInfo) when a load error occurs. The LoadErrorHandlingPolicy.FallbackSelection returned by the policy defines whether the loader should fall back to using another resource, and if so the duration for which the failing resource should be excluded.
When fallback does not take place, a loader will call getRetryDelayMsFor(LoadErrorInfo). The value returned by the policy defines whether the failed load can be retried, and if so the duration to wait before retrying. If the policy indicates that a load error should not be retried, it will be considered fatal by the loader. The loader may also consider load errors that can be retried fatal if at least getMinimumLoadableRetryCount(int) retries have been attempted.
Methods are invoked on the playback thread.
Nested Classes | Modifier and Type | Interface | Description |
| --- | --- | --- |
| static class | LoadErrorHandlingPolicy.FallbackOptions |
Deprecated.
Holds information about the available fallback options.
|
| static class | LoadErrorHandlingPolicy.FallbackSelection |
Deprecated.
A selected fallback option.
|
| static interface | LoadErrorHandlingPolicy.FallbackType |
Deprecated.
Fallback type.
|
| static class | LoadErrorHandlingPolicy.LoadErrorInfo |
Deprecated.
Holds information about a load task error. |
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static int | FALLBACK_TYPE_LOCATION |
Deprecated.
Fallback to the same resource at a different location (i.e., a different URL through which the exact same data can be requested).
|
| static int | FALLBACK_TYPE_TRACK |
Deprecated.
Fallback to a different track (i.e., a different representation of the same content; for example the same video encoded at a different bitrate or resolution). |
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| LoadErrorHandlingPolicy.FallbackSelection | getFallbackSelectionFor(LoadErrorHandlingPolicy.FallbackOptions fallbackOptions, LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo) |
Deprecated.
Returns whether a loader should fall back to using another resource on encountering an error, and if so the duration for which the failing resource should be excluded.
|
| int | getMinimumLoadableRetryCount(int dataType) |
Deprecated.
Returns the minimum number of times to retry a load before a load error that can be retried may be considered fatal.
|
| long | getRetryDelayMsFor(LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo) |
Deprecated.
Returns whether a loader can retry on encountering an error, and if so the duration to wait before retrying.
|
| default void | onLoadTaskConcluded(long loadTaskId) |
Deprecated.
Called once loadTaskId will not be associated with any more load errors.
|
-
static final int FALLBACK_TYPE_LOCATION
Deprecated.
Fallback to the same resource at a different location (i.e., a different URL through which the exact same data can be requested). See Also:Constant Field Values
-
static final int FALLBACK_TYPE_TRACK
Deprecated.
Fallback to a different track (i.e., a different representation of the same content; for example the same video encoded at a different bitrate or resolution). See Also:Constant Field Values
-
@Nullable[LoadErrorHandlingPolicy.FallbackSelection](LoadErrorHandlingPolicy.FallbackSelection.html "class in com.google.android.exoplayer2.upstream")getFallbackSelectionFor([LoadErrorHandlingPolicy.FallbackOptions](LoadErrorHandlingPolicy.FallbackOptions.html "class in com.google.android.exoplayer2.upstream")fallbackOptions,[LoadErrorHandlingPolicy.LoadErrorInfo](LoadErrorHandlingPolicy.LoadErrorInfo.html "class in com.google.android.exoplayer2.upstream")loadErrorInfo)
Deprecated.
Returns whether a loader should fall back to using another resource on encountering an error, and if so the duration for which the failing resource should be excluded.
If the returned fallback type was not advertised as available, then the loader will not fall back.
Parameters:fallbackOptions - The available fallback options.loadErrorInfo - A LoadErrorHandlingPolicy.LoadErrorInfo holding information about the load error.Returns:The selected fallback, or null if the calling loader should not fall back.
-
long getRetryDelayMsFor([LoadErrorHandlingPolicy.LoadErrorInfo](LoadErrorHandlingPolicy.LoadErrorInfo.html "class in com.google.android.exoplayer2.upstream")loadErrorInfo)
Deprecated.
Returns whether a loader can retry on encountering an error, and if so the duration to wait before retrying. A return value of C.TIME_UNSET indicates that the error is fatal and should not be retried.
For loads that can be retried, loaders may ignore the retry delay returned by this method in order to wait for a specific event before retrying.
Parameters:loadErrorInfo - A LoadErrorHandlingPolicy.LoadErrorInfo holding information about the load error.Returns:The duration to wait before retrying in milliseconds, or C.TIME_UNSET if the error is fatal and should not be retried.
-
default void onLoadTaskConcluded(long loadTaskId)
Deprecated.
Called once loadTaskId will not be associated with any more load errors.
Implementations should clean up any resources associated with loadTaskId when this method is called.
-
int getMinimumLoadableRetryCount(int dataType)
Deprecated.
Returns the minimum number of times to retry a load before a load error that can be retried may be considered fatal.
Parameters:dataType - One of the C.DATA_TYPE_* constants indicating the type of data being loaded.Returns:The minimum number of times to retry a load before a load error that can be retried may be considered fatal.See Also:Loader.startLoading(Loadable, Callback, int)