public final class ChunkedTrackBlacklistUtil
extends java.lang.Object
TrackSelection when 404 (Not Found) and 410
(Gone) HTTP response codes are encountered.| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_TRACK_BLACKLIST_MS
The default duration for which a track is blacklisted in milliseconds.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
maybeBlacklistTrack(TrackSelection trackSelection,
int trackSelectionIndex,
java.lang.Exception e)
Blacklists
trackSelectionIndex in trackSelection for
DEFAULT_TRACK_BLACKLIST_MS if e is an HttpDataSource.InvalidResponseCodeException
with HttpDataSource.InvalidResponseCodeException.responseCode equal to 404 or 410. |
static boolean |
maybeBlacklistTrack(TrackSelection trackSelection,
int trackSelectionIndex,
java.lang.Exception e,
long blacklistDurationMs)
Blacklists
trackSelectionIndex in trackSelection for
blacklistDurationMs if calling shouldBlacklist(Exception) for e
returns true. |
static boolean |
shouldBlacklist(java.lang.Exception e)
Returns whether a loading error is an
HttpDataSource.InvalidResponseCodeException with
HttpDataSource.InvalidResponseCodeException.responseCode equal to 404 or 410. |
public static final long DEFAULT_TRACK_BLACKLIST_MS
public static boolean maybeBlacklistTrack(TrackSelection trackSelection, int trackSelectionIndex, java.lang.Exception e)
trackSelectionIndex in trackSelection for
DEFAULT_TRACK_BLACKLIST_MS if e is an HttpDataSource.InvalidResponseCodeException
with HttpDataSource.InvalidResponseCodeException.responseCode equal to 404 or 410. Else does nothing.
Note that blacklisting will fail if the track is the only non-blacklisted track in the
selection.trackSelection - The track selection.trackSelectionIndex - The index in the selection to consider blacklisting.e - The error to inspect.public static boolean maybeBlacklistTrack(TrackSelection trackSelection, int trackSelectionIndex, java.lang.Exception e, long blacklistDurationMs)
trackSelectionIndex in trackSelection for
blacklistDurationMs if calling shouldBlacklist(Exception) for e
returns true. Else does nothing. Note that blacklisting will fail if the track is the only
non-blacklisted track in the selection.trackSelection - The track selection.trackSelectionIndex - The index in the selection to consider blacklisting.e - The error to inspect.blacklistDurationMs - The duration to blacklist the track for, if it is blacklisted.public static boolean shouldBlacklist(java.lang.Exception e)
HttpDataSource.InvalidResponseCodeException with
HttpDataSource.InvalidResponseCodeException.responseCode equal to 404 or 410.e - The loading error.HttpDataSource.InvalidResponseCodeException with
HttpDataSource.InvalidResponseCodeException.responseCode equal to 404 or 410.