# StuckPlayerException

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/util/StuckPlayerException.java+class:androidx.media3.common.util.StuckPlayerException)

*** ** * ** ***


```
@UnstableApi
public final class StuckPlayerException extends IllegalStateException
```

<br />

|---|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html) |||
|   |   |   | ↳ | [java.lang.IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException.html) ||
|   |   |   |   | ↳ | [androidx.media3.common.util.StuckPlayerException](https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException) |

*** ** * ** ***

Exception thrown when the player is stuck in `https://developer.android.com/reference/androidx/media3/common/Player#STATE_READY()` or `https://developer.android.com/reference/androidx/media3/common/Player#STATE_BUFFERING()` while `https://developer.android.com/reference/androidx/media3/common/Player#getPlayWhenReady()` is true without observable progress and no means of unblocking itself.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException.StuckType` The type of stuck playback. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#STUCK_BUFFERING_NOT_LOADING() = 0` The player is stuck because it's in `https://developer.android.com/reference/androidx/media3/common/Player#STATE_BUFFERING()`, needs to load more data to make progress, but is not loading. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#STUCK_BUFFERING_NO_PROGRESS() = 1` The player is stuck because it's in `https://developer.android.com/reference/androidx/media3/common/Player#STATE_BUFFERING()`, but no loading progress is made and the player is also not able to become ready. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#STUCK_PLAYING_NOT_ENDING() = 3` The player is stuck because it's in `https://developer.android.com/reference/androidx/media3/common/Player#STATE_READY()`, but it's not able to end playback despite exceeding the declared duration. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#STUCK_PLAYING_NO_PROGRESS() = 2` The player is stuck because it's in `https://developer.android.com/reference/androidx/media3/common/Player#STATE_READY()`, but no progress is made. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#STUCK_SUPPRESSED() = 4` The player is stuck with a suppression reason other than `https://developer.android.com/reference/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_NONE()` or `https://developer.android.com/reference/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS()`. |

| ### Public fields |
|---|---|
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException.StuckType https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#stuckType()` The type of stuck playback. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#timeoutMs()` The timeout after which the exception was triggered, in milliseconds. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#StuckPlayerException(int,int)( @https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException.StuckType int stuckType, int timeoutMs )` Creates an instance. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `int` | `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException#hashCode()()` |

### Inherited methods

From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) `synchronized final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html exception)` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `StackTraceElement[]` `https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `synchronized final Throwable[]` `https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(StackTraceElement[] stackTrace)` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#toString()()`

## Constants

### STUCK_BUFFERING_NOT_LOADING

```
public static final int STUCK_BUFFERING_NOT_LOADING = 0
```

The player is stuck because it's in `https://developer.android.com/reference/androidx/media3/common/Player#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 `https://developer.android.com/reference/androidx/media3/common/Player#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 `https://developer.android.com/reference/androidx/media3/common/Player#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 `https://developer.android.com/reference/androidx/media3/common/Player#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 `https://developer.android.com/reference/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_NONE()` or `https://developer.android.com/reference/androidx/media3/common/Player#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 |
|---|---|
| `@https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException.StuckType int stuckType` | The `https://developer.android.com/reference/androidx/media3/common/util/StuckPlayerException.StuckType`. |
| `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()
```