StuckPlayerException


@UnstableApi
public final class StuckPlayerException extends IllegalStateException


Exception thrown when the player is stuck in STATE_READY or STATE_BUFFERING while getPlayWhenReady is true without observable progress and no means of unblocking itself.

Summary

Nested types

The type of stuck playback.

Constants

static final int

The player is stuck because it's in STATE_BUFFERING, needs to load more data to make progress, but is not loading.

static final int

The player is stuck because it's in STATE_BUFFERING, but no loading progress is made and the player is also not able to become ready.

static final int

The player is stuck because it's in STATE_READY, but it's not able to end playback despite exceeding the declared duration.

static final int

The player is stuck because it's in STATE_READY, but no progress is made.

static final int

The player is stuck with a suppression reason other than PLAYBACK_SUPPRESSION_REASON_NONE or PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS.

Public fields

final int

The type of stuck playback.

final int

The timeout after which the exception was triggered, in milliseconds.

Public constructors

StuckPlayerException(
    @StuckPlayerException.StuckType int stuckType,
    int timeoutMs
)

Creates an instance.

Public methods

boolean
int

Inherited methods

From java.lang.Throwable
synchronized final void
synchronized Throwable
synchronized Throwable
String
String
StackTraceElement[]
synchronized final Throwable[]
synchronized Throwable
void
void
setStackTrace(StackTraceElement[] stackTrace)
String

Constants

STUCK_BUFFERING_NOT_LOADING

public static final int STUCK_BUFFERING_NOT_LOADING = 0

The player is stuck because it's in STATE_BUFFERING, needs to load more data to make progress, but is not loading.

STUCK_BUFFERING_NO_PROGRESS

public static final int STUCK_BUFFERING_NO_PROGRESS = 1

The player is stuck because it's in STATE_BUFFERING, but no loading progress is made and the player is also not able to become ready.

STUCK_PLAYING_NOT_ENDING

public static final int STUCK_PLAYING_NOT_ENDING = 3

The player is stuck because it's in STATE_READY, but it's not able to end playback despite exceeding the declared duration.

STUCK_PLAYING_NO_PROGRESS

public static final int STUCK_PLAYING_NO_PROGRESS = 2

The player is stuck because it's in STATE_READY, but no progress is made.

STUCK_SUPPRESSED

public static final int STUCK_SUPPRESSED = 4

The player is stuck with a suppression reason other than PLAYBACK_SUPPRESSION_REASON_NONE or PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS.

Public fields

stuckType

@StuckPlayerException.StuckType
public final int stuckType

The type of stuck playback.

timeoutMs

public final int timeoutMs

The timeout after which the exception was triggered, in milliseconds.

Public constructors

StuckPlayerException

public StuckPlayerException(
    @StuckPlayerException.StuckType int stuckType,
    int timeoutMs
)

Creates an instance.

Parameters
@StuckPlayerException.StuckType int stuckType

The type of stuck playback.

int timeoutMs

The timeout after which the exception was triggered, in milliseconds.

Public methods

equals

public boolean equals(@Nullable Object obj)

hashCode

public int hashCode()