# 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
class StuckPlayerException : IllegalStateException
```

<br />

|---|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.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/kotlin/androidx/media3/common/util/StuckPlayerException) |

*** ** * ** ***

Exception thrown when the player is stuck in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()` or `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_BUFFERING()` while `https://developer.android.com/reference/kotlin/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/kotlin/androidx/annotation/IntDef(value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException.StuckType` The type of stuck playback. |

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

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#StuckPlayerException(int,int)( @https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException.StuckType stuckType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, timeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates an instance. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#hashCode()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException.StuckType https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#stuckType()` The type of stuck playback. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException#timeoutMs()` The timeout after which the exception was triggered, in milliseconds. |

| ### Inherited functions |
|---|
| From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/set-stack-trace.html(stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/to-string.html()` | |

## Constants

### STUCK_BUFFERING_NOT_LOADING

```
const val STUCK_BUFFERING_NOT_LOADING = 0: Int
```

The player is stuck because it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_BUFFERING()`, needs to load more data to make progress, but is not loading.

### STUCK_BUFFERING_NO_PROGRESS

```
const val STUCK_BUFFERING_NO_PROGRESS = 1: Int
```

The player is stuck because it's in `https://developer.android.com/reference/kotlin/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

```
const val STUCK_PLAYING_NOT_ENDING = 3: Int
```

The player is stuck because it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()`, but it's not able to end playback despite exceeding the declared duration.

### STUCK_PLAYING_NO_PROGRESS

```
const val STUCK_PLAYING_NO_PROGRESS = 2: Int
```

The player is stuck because it's in `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_READY()`, but no progress is made.

### STUCK_SUPPRESSED

```
const val STUCK_SUPPRESSED = 4: Int
```

The player is stuck with a suppression reason other than `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_NONE()` or `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#PLAYBACK_SUPPRESSION_REASON_TRANSIENT_AUDIO_FOCUS_LOSS()`.

## Public constructors

### StuckPlayerException

```
StuckPlayerException(
    @StuckPlayerException.StuckType stuckType: Int,
    timeoutMs: Int
)
```

Creates an instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException.StuckType stuckType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/util/StuckPlayerException.StuckType`. |
| `timeoutMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The timeout after which the exception was triggered, in milliseconds. |

## Public functions

### equals

```
fun equals(obj: Any?): Boolean
```

### hashCode

```
fun hashCode(): Int
```

## Public properties

### stuckType

```
@StuckPlayerException.StuckType
val stuckType: Int
```

The type of stuck playback.

### timeoutMs

```
val timeoutMs: Int
```

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