docs/doc/reference/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.html
Package com.google.android.exoplayer2.upstream
All Implemented Interfaces:LoadErrorHandlingPolicy
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classDefaultLoadErrorHandlingPolicyextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[LoadErrorHandlingPolicy](LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")
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.
Default implementation of LoadErrorHandlingPolicy.
-
LoadErrorHandlingPolicy.FallbackOptions, LoadErrorHandlingPolicy.FallbackSelection, LoadErrorHandlingPolicy.FallbackType, LoadErrorHandlingPolicy.LoadErrorInfo
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static long | DEFAULT_LOCATION_EXCLUSION_MS |
Deprecated.
The default duration for which a location is excluded in milliseconds.
|
| static int | DEFAULT_MIN_LOADABLE_RETRY_COUNT |
Deprecated.
The default minimum number of times to retry loading data prior to propagating the error.
|
| static int | DEFAULT_MIN_LOADABLE_RETRY_COUNT_PROGRESSIVE_LIVE |
Deprecated.
The default minimum number of times to retry loading prior to failing for progressive live streams.
|
| static long | DEFAULT_TRACK_BLACKLIST_MS |
Deprecated.
Use DEFAULT_TRACK_EXCLUSION_MS instead.
|
| static long | DEFAULT_TRACK_EXCLUSION_MS |
Deprecated.
The default duration for which a track is excluded in milliseconds. |
-
FALLBACK_TYPE_LOCATION, FALLBACK_TYPE_TRACK
Constructors | Constructor | Description |
| --- | --- |
| DefaultLoadErrorHandlingPolicy() |
Deprecated.
Creates an instance with default behavior.
|
| DefaultLoadErrorHandlingPolicy(int minimumLoadableRetryCount) |
Deprecated.
Creates an instance with the given value for getMinimumLoadableRetryCount(int).
|
All Methods Instance Methods Concrete 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.
See DefaultLoadErrorHandlingPolicy() and DefaultLoadErrorHandlingPolicy(int) for documentation about the behavior of this method.
|
| long | getRetryDelayMsFor(LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo) |
Deprecated.
Retries for any exception that is not a subclass of ParserException, FileNotFoundException, HttpDataSource.CleartextNotPermittedException or Loader.UnexpectedLoaderException, and for which DataSourceException.isCausedByPositionOutOfRange(java.io.IOException) returns false.
|
| protected boolean | isEligibleForFallback(IOException exception) |
Deprecated.
Returns whether an error should trigger a fallback if possible. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
onLoadTaskConcluded
-
public static final int DEFAULT_MIN_LOADABLE_RETRY_COUNT
Deprecated.
The default minimum number of times to retry loading data prior to propagating the error. See Also:Constant Field Values
-
public static final int DEFAULT_MIN_LOADABLE_RETRY_COUNT_PROGRESSIVE_LIVE
Deprecated.
The default minimum number of times to retry loading prior to failing for progressive live streams. See Also:Constant Field Values
-
public static final long DEFAULT_TRACK_EXCLUSION_MS
Deprecated.
The default duration for which a track is excluded in milliseconds. See Also:Constant Field Values
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public static final long DEFAULT_TRACK_BLACKLIST_MS
Deprecated.
Use DEFAULT_TRACK_EXCLUSION_MS instead.
See Also:Constant Field Values
-
public static final long DEFAULT_LOCATION_EXCLUSION_MS
Deprecated.
The default duration for which a location is excluded in milliseconds. See Also:Constant Field Values
-
public DefaultLoadErrorHandlingPolicy()
Deprecated.
Creates an instance with default behavior.
getMinimumLoadableRetryCount(int) will return DEFAULT_MIN_LOADABLE_RETRY_COUNT_PROGRESSIVE_LIVE for dataType C.DATA_TYPE_MEDIA_PROGRESSIVE_LIVE. For other dataType values, it will return DEFAULT_MIN_LOADABLE_RETRY_COUNT.
-
public DefaultLoadErrorHandlingPolicy(int minimumLoadableRetryCount)
Deprecated.
Creates an instance with the given value for getMinimumLoadableRetryCount(int).
Parameters:minimumLoadableRetryCount - See getMinimumLoadableRetryCount(int).
-
@Nullable
public[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.
- This policy will only specify a fallback if isEligibleForFallback(java.io.IOException) returns true for the error.
- This policy will always specify a location fallback rather than a track fallback if both are available.
- When a fallback is specified, the duration for which the failing resource will be excluded is DEFAULT_LOCATION_EXCLUSION_MS or DEFAULT_TRACK_EXCLUSION_MS, depending on the fallback type.
Specified by:getFallbackSelectionFor in interface LoadErrorHandlingPolicyParameters: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.
-
public long getRetryDelayMsFor([LoadErrorHandlingPolicy.LoadErrorInfo](LoadErrorHandlingPolicy.LoadErrorInfo.html "class in com.google.android.exoplayer2.upstream")loadErrorInfo)
Deprecated.
Retries for any exception that is not a subclass of ParserException, FileNotFoundException, HttpDataSource.CleartextNotPermittedException or Loader.UnexpectedLoaderException, and for which DataSourceException.isCausedByPositionOutOfRange(java.io.IOException) returns false. The retry delay is calculated as Math.min((errorCount - 1) * 1000, 5000).
Specified by:getRetryDelayMsFor in interface LoadErrorHandlingPolicyParameters: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.
-
public int getMinimumLoadableRetryCount(int dataType)
Deprecated.
See DefaultLoadErrorHandlingPolicy() and DefaultLoadErrorHandlingPolicy(int) for documentation about the behavior of this method.
Specified by:getMinimumLoadableRetryCount in interface LoadErrorHandlingPolicyParameters: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)
-
protected boolean isEligibleForFallback([IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")exception)
Deprecated.
Returns whether an error should trigger a fallback if possible.