public final class ChunkedTrackBlacklistUtil extends 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,
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,
Exception e,
long blacklistDurationMs)
Blacklists
trackSelectionIndex in trackSelection for
blacklistDurationMs if e 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, 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, Exception e, long blacklistDurationMs)
trackSelectionIndex
in trackSelection
for
blacklistDurationMs
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.blacklistDurationMs
- The duration to blacklist the track for, if it is blacklisted.