# PlaybackException

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/PlaybackException.java+class:androidx.media3.common.PlaybackException)

*** ** * ** ***


```
public class PlaybackException extends Exception
```

<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) ||
|   |   | ↳ | [androidx.media3.common.PlaybackException](https://developer.android.com/reference/androidx/media3/common/PlaybackException) |

Known direct subclasses [ExoPlaybackException](https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlaybackException)

|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlaybackException` | Thrown when a non locally recoverable playback failure occurs. |

*** ** * ** ***

Thrown when a non locally recoverable playback failure occurs.

## 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/androidx/annotation/IntDef(open = true, value = ) public annotation https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode` Codes that identify causes of player errors. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#CUSTOM_ERROR_CODE_BASE() = 1000000` Player implementations that want to surface custom errors can use error codes greater than this value, so as to avoid collision with other error codes defined in this class. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_AUDIO_TRACK_INIT_FAILED() = 5001` Caused by an AudioTrack initialization failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_AUDIO_TRACK_OFFLOAD_INIT_FAILED() = 5004` Caused by an AudioTrack init operation failure in offload mode. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_AUDIO_TRACK_OFFLOAD_WRITE_FAILED() = 5003` Caused by an AudioTrack write operation failure in offload mode. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_AUDIO_TRACK_WRITE_FAILED() = 5002` Caused by an AudioTrack write operation failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_AUTHENTICATION_EXPIRED() = -102` Caused by expired authentication. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_BAD_VALUE() = -3` Caused by an argument that is illegal. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_BEHIND_LIVE_WINDOW() = 1002` Caused by the loading position falling behind the sliding window of available live content. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_CONCURRENT_STREAM_LIMIT() = -104` Caused by too many concurrent streams. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_CONTENT_ALREADY_PLAYING() = -110` Caused by a request for content that was already playing. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DECODER_INIT_FAILED() = 4001` Caused by a decoder initialization failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DECODER_QUERY_FAILED() = 4002` Caused by a decoder query failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DECODING_FAILED() = 4003` Caused by a failure while trying to decode media samples. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES() = 4004` Caused by trying to decode content whose format exceeds the capabilities of the device. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DECODING_FORMAT_UNSUPPORTED() = 4005` Caused by trying to decode content whose format is not supported. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DECODING_RESOURCES_RECLAIMED() = 4006` Caused by higher priority task reclaiming resources needed for decoding. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DISCONNECTED() = -100` Caused by a disconnected component. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_CONTENT_ERROR() = 6003` Caused by attempting to play incompatible DRM-protected content. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_DEVICE_REVOKED() = 6007` Caused by the device having revoked DRM privileges. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_DISALLOWED_OPERATION() = 6005` Caused by an operation being disallowed by a license policy. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED() = 6004` Caused by a failure while trying to obtain a license. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_LICENSE_EXPIRED() = 6008` Caused by an expired DRM license being loaded into an open DRM session. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_PROVISIONING_FAILED() = 6002` Caused by a failure while provisioning the device. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_SCHEME_UNSUPPORTED() = 6001` Caused by a chosen DRM protection scheme not being supported by the device. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_SYSTEM_ERROR() = 6006` Caused by an error in the DRM system. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_DRM_UNSPECIFIED() = 6000` Caused by an unspecified error related to DRM protection. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_END_OF_PLAYLIST() = -109` Caused by navigation that failed because the playlist was exhausted. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_FAILED_RUNTIME_CHECK() = 1004` Caused by a failed runtime check. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_INVALID_STATE() = -2` Caused by a command that cannot be completed because the current state is not valid. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_BAD_HTTP_STATUS() = 2004` Caused by an HTTP server returning an unexpected HTTP response status code. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED() = 2007` Caused by the player trying to access cleartext HTTP traffic (meaning http:// rather than https://) when the app's Network Security Configuration does not permit it. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_FILE_NOT_FOUND() = 2005` Caused by a non-existent file. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE() = 2003` Caused by a server returning a resource with an invalid "Content-Type" HTTP header value. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_NETWORK_CONNECTION_FAILED() = 2001` Caused by a network connection failure. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT() = 2002` Caused by a network timeout, meaning the server is taking too long to fulfill a request. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_NO_PERMISSION() = 2006` Caused by lack of permission to perform an IO operation. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE() = 2008` Caused by reading data out of the data bound. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_IO_UNSPECIFIED() = 2000` Caused by an Input/Output error which could not be identified. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_NOT_AVAILABLE_IN_REGION() = -106` Caused by the content being blocked due to being regionally unavailable. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_NOT_SUPPORTED() = -6` Caused by a command that is not supported. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_PARENTAL_CONTROL_RESTRICTED() = -105` Caused by the content being blocked due to parental controls. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_PARSING_CONTAINER_MALFORMED() = 3001` Caused by a parsing error associated with a media container format bitstream. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED() = 3003` Caused by attempting to extract a file with an unsupported media container format, or an unsupported media container feature. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_PARSING_MANIFEST_MALFORMED() = 3002` Caused by a parsing error associated with a media manifest. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED() = 3004` Caused by an unsupported feature in a media manifest. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_PERMISSION_DENIED() = -4` Caused by a command that is not allowed. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_PREMIUM_ACCOUNT_REQUIRED() = -103` Caused by a premium account that is required but the user is not subscribed. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_REMOTE_ERROR() = 1001` Caused by an unidentified error in a remote Player, which is a Player that runs on a different host or process. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_SETUP_REQUIRED() = -108` Caused by playback that needs manual user intervention. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_SKIP_LIMIT_REACHED() = -107` Caused by the skip limit that is exhausted. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_TIMEOUT() = 1003` Caused by a generic timeout. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_UNSPECIFIED() = 1000` Caused by an error whose cause could not be identified. |
| `static final int` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED() = 7001` Caused by a failure when processing a video frame. |
| `static final int` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED() = 7000` Caused by a failure when initializing a `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor`. |
| `static final int` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#FIELD_CUSTOM_ID_BASE() = 1000` Defines a minimum field ID value for subclasses to use when implementing `https://developer.android.com/reference/androidx/media3/common/PlaybackException#toBundle()` and delegating to `https://developer.android.com/reference/androidx/media3/common/PlaybackException#PlaybackException(android.os.Bundle)`. |

| ### Public fields |
|---|---|
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode https://developer.android.com/reference/androidx/media3/common/PlaybackException#errorCode()` An error code which identifies the cause of the playback failure. |
| `final https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#extras()` An extras `https://developer.android.com/reference/android/os/Bundle.html`. |
| `final long` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#timestampMs()` The value of `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when this exception was created. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#PlaybackException(java.lang.String,java.lang.Throwable,int)( @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html message, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Throwable.html cause, @https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode int errorCode )` Creates an instance. |
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#PlaybackException(java.lang.String,java.lang.Throwable,int,android.os.Bundle)( @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html message, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Throwable.html cause, @https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode int errorCode, https://developer.android.com/reference/android/os/Bundle.html extras )` Creates an instance. |

| ### Protected constructors |
|---|
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#PlaybackException(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Creates a new instance using the fields obtained from the given `https://developer.android.com/reference/android/os/Bundle.html`. |
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#PlaybackException(java.lang.String,java.lang.Throwable,int,android.os.Bundle,long)( @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html message, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Throwable.html cause, @https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode int errorCode, https://developer.android.com/reference/android/os/Bundle.html extras, long timestampMs )` Creates a new instance using the given values. |

| ### Public methods |
|---|---|
| `static boolean` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#areErrorInfosEqual(androidx.media3.common.PlaybackException,androidx.media3.common.PlaybackException)( @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/PlaybackException playbackException1, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/PlaybackException playbackException2 )` Returns true if both `https://developer.android.com/reference/androidx/media3/common/PlaybackException` instances have `https://developer.android.com/reference/androidx/media3/common/PlaybackException#errorInfoEquals(androidx.media3.common.PlaybackException)` or both are null. |
| `boolean` | `@https://developer.android.com/reference/androidx/annotation/CallSuper https://developer.android.com/reference/androidx/media3/common/PlaybackException#errorInfoEquals(androidx.media3.common.PlaybackException)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/PlaybackException other)` Returns whether the error data associated to this exception equals the error data associated to `other`. |
| `static https://developer.android.com/reference/androidx/media3/common/PlaybackException` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/PlaybackException#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Restores a `PlaybackException` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#getErrorCodeName()()` Equivalent to `https://developer.android.com/reference/androidx/media3/common/PlaybackException#getErrorCodeName(int)`. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/common/PlaybackException#getErrorCodeName(int)(@https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode int errorCode)` Returns the name of a given `errorCode`. |
| `https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/androidx/annotation/CallSuper https://developer.android.com/reference/androidx/media3/common/PlaybackException#toBundle()()` Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this exception. |

### 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

### CUSTOM_ERROR_CODE_BASE

```
public static final int CUSTOM_ERROR_CODE_BASE = 1000000
```

Player implementations that want to surface custom errors can use error codes greater than this value, so as to avoid collision with other error codes defined in this class.

### ERROR_CODE_AUDIO_TRACK_INIT_FAILED

```
public static final int ERROR_CODE_AUDIO_TRACK_INIT_FAILED = 5001
```

Caused by an AudioTrack initialization failure.

### ERROR_CODE_AUDIO_TRACK_OFFLOAD_INIT_FAILED

```
public static final int ERROR_CODE_AUDIO_TRACK_OFFLOAD_INIT_FAILED = 5004
```

Caused by an AudioTrack init operation failure in offload mode.

### ERROR_CODE_AUDIO_TRACK_OFFLOAD_WRITE_FAILED

```
public static final int ERROR_CODE_AUDIO_TRACK_OFFLOAD_WRITE_FAILED = 5003
```

Caused by an AudioTrack write operation failure in offload mode.

### ERROR_CODE_AUDIO_TRACK_WRITE_FAILED

```
public static final int ERROR_CODE_AUDIO_TRACK_WRITE_FAILED = 5002
```

Caused by an AudioTrack write operation failure.

### ERROR_CODE_AUTHENTICATION_EXPIRED

```
public static final int ERROR_CODE_AUTHENTICATION_EXPIRED = -102
```

Caused by expired authentication.

### ERROR_CODE_BAD_VALUE

```
public static final int ERROR_CODE_BAD_VALUE = -3
```

Caused by an argument that is illegal.

### ERROR_CODE_BEHIND_LIVE_WINDOW

```
public static final int ERROR_CODE_BEHIND_LIVE_WINDOW = 1002
```

Caused by the loading position falling behind the sliding window of available live content.

### ERROR_CODE_CONCURRENT_STREAM_LIMIT

```
public static final int ERROR_CODE_CONCURRENT_STREAM_LIMIT = -104
```

Caused by too many concurrent streams.

### ERROR_CODE_CONTENT_ALREADY_PLAYING

```
public static final int ERROR_CODE_CONTENT_ALREADY_PLAYING = -110
```

Caused by a request for content that was already playing.

### ERROR_CODE_DECODER_INIT_FAILED

```
public static final int ERROR_CODE_DECODER_INIT_FAILED = 4001
```

Caused by a decoder initialization failure.

### ERROR_CODE_DECODER_QUERY_FAILED

```
public static final int ERROR_CODE_DECODER_QUERY_FAILED = 4002
```

Caused by a decoder query failure.

### ERROR_CODE_DECODING_FAILED

```
public static final int ERROR_CODE_DECODING_FAILED = 4003
```

Caused by a failure while trying to decode media samples.

### ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES

```
public static final int ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES = 4004
```

Caused by trying to decode content whose format exceeds the capabilities of the device.

### ERROR_CODE_DECODING_FORMAT_UNSUPPORTED

```
public static final int ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 4005
```

Caused by trying to decode content whose format is not supported.

### ERROR_CODE_DECODING_RESOURCES_RECLAIMED

```
public static final int ERROR_CODE_DECODING_RESOURCES_RECLAIMED = 4006
```

Caused by higher priority task reclaiming resources needed for decoding.

### ERROR_CODE_DISCONNECTED

```
public static final int ERROR_CODE_DISCONNECTED = -100
```

Caused by a disconnected component.

### ERROR_CODE_DRM_CONTENT_ERROR

```
public static final int ERROR_CODE_DRM_CONTENT_ERROR = 6003
```

Caused by attempting to play incompatible DRM-protected content.

For example, this can happen when attempting to play a DRM protected stream using a scheme (like Widevine) for which there is no corresponding license acquisition data (like a pssh box).

### ERROR_CODE_DRM_DEVICE_REVOKED

```
public static final int ERROR_CODE_DRM_DEVICE_REVOKED = 6007
```

Caused by the device having revoked DRM privileges.

### ERROR_CODE_DRM_DISALLOWED_OPERATION

```
public static final int ERROR_CODE_DRM_DISALLOWED_OPERATION = 6005
```

Caused by an operation being disallowed by a license policy.

### ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED

```
public static final int ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED = 6004
```

Caused by a failure while trying to obtain a license.

### ERROR_CODE_DRM_LICENSE_EXPIRED

```
public static final int ERROR_CODE_DRM_LICENSE_EXPIRED = 6008
```

Caused by an expired DRM license being loaded into an open DRM session.

### ERROR_CODE_DRM_PROVISIONING_FAILED

```
public static final int ERROR_CODE_DRM_PROVISIONING_FAILED = 6002
```

Caused by a failure while provisioning the device.

### ERROR_CODE_DRM_SCHEME_UNSUPPORTED

```
public static final int ERROR_CODE_DRM_SCHEME_UNSUPPORTED = 6001
```

Caused by a chosen DRM protection scheme not being supported by the device. Examples of DRM protection schemes are ClearKey and Widevine.

### ERROR_CODE_DRM_SYSTEM_ERROR

```
public static final int ERROR_CODE_DRM_SYSTEM_ERROR = 6006
```

Caused by an error in the DRM system.

### ERROR_CODE_DRM_UNSPECIFIED

```
public static final int ERROR_CODE_DRM_UNSPECIFIED = 6000
```

Caused by an unspecified error related to DRM protection.

### ERROR_CODE_END_OF_PLAYLIST

```
public static final int ERROR_CODE_END_OF_PLAYLIST = -109
```

Caused by navigation that failed because the playlist was exhausted.

### ERROR_CODE_FAILED_RUNTIME_CHECK

```
public static final int ERROR_CODE_FAILED_RUNTIME_CHECK = 1004
```

Caused by a failed runtime check.

This can happen when the application fails to comply with the player's API requirements (for example, by passing invalid arguments), or when the player reaches an invalid state.

### ERROR_CODE_INVALID_STATE

```
public static final int ERROR_CODE_INVALID_STATE = -2
```

Caused by a command that cannot be completed because the current state is not valid.

### ERROR_CODE_IO_BAD_HTTP_STATUS

```
public static final int ERROR_CODE_IO_BAD_HTTP_STATUS = 2004
```

Caused by an HTTP server returning an unexpected HTTP response status code.

### ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED

```
public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007
```

Caused by the player trying to access cleartext HTTP traffic (meaning http:// rather than https://) when the app's Network Security Configuration does not permit it.

See [this corresponding troubleshooting topic](https://developer.android.com/guide/topics/media/issues/cleartext-not-permitted).

### ERROR_CODE_IO_FILE_NOT_FOUND

```
public static final int ERROR_CODE_IO_FILE_NOT_FOUND = 2005
```

Caused by a non-existent file.

### ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE

```
public static final int ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE = 2003
```

Caused by a server returning a resource with an invalid "Content-Type" HTTP header value.

For example, this can happen when the player is expecting a piece of media, but the server returns a paywall HTML page, with content type "text/html".

### ERROR_CODE_IO_NETWORK_CONNECTION_FAILED

```
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 2001
```

Caused by a network connection failure.

The following is a non-exhaustive list of possible reasons:

- There is no network connectivity (you can check this by querying `https://developer.android.com/reference/android/net/ConnectivityManager.html#getActiveNetwork()`).
- The URL's domain is misspelled or does not exist.
- The target host is unreachable.
- The server unexpectedly closes the connection.

### ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT

```
public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 2002
```

Caused by a network timeout, meaning the server is taking too long to fulfill a request.

### ERROR_CODE_IO_NO_PERMISSION

```
public static final int ERROR_CODE_IO_NO_PERMISSION = 2006
```

Caused by lack of permission to perform an IO operation. For example, lack of permission to access internet or external storage.

### ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE

```
public static final int ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 2008
```

Caused by reading data out of the data bound.

### ERROR_CODE_IO_UNSPECIFIED

```
public static final int ERROR_CODE_IO_UNSPECIFIED = 2000
```

Caused by an Input/Output error which could not be identified.

### ERROR_CODE_NOT_AVAILABLE_IN_REGION

```
public static final int ERROR_CODE_NOT_AVAILABLE_IN_REGION = -106
```

Caused by the content being blocked due to being regionally unavailable.

### ERROR_CODE_NOT_SUPPORTED

```
public static final int ERROR_CODE_NOT_SUPPORTED = -6
```

Caused by a command that is not supported.

### ERROR_CODE_PARENTAL_CONTROL_RESTRICTED

```
public static final int ERROR_CODE_PARENTAL_CONTROL_RESTRICTED = -105
```

Caused by the content being blocked due to parental controls.

### ERROR_CODE_PARSING_CONTAINER_MALFORMED

```
public static final int ERROR_CODE_PARSING_CONTAINER_MALFORMED = 3001
```

Caused by a parsing error associated with a media container format bitstream.

### ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED

```
public static final int ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED = 3003
```

Caused by attempting to extract a file with an unsupported media container format, or an unsupported media container feature.

### ERROR_CODE_PARSING_MANIFEST_MALFORMED

```
public static final int ERROR_CODE_PARSING_MANIFEST_MALFORMED = 3002
```

Caused by a parsing error associated with a media manifest. Examples of a media manifest are a DASH or a SmoothStreaming manifest, or an HLS playlist.

### ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED

```
public static final int ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED = 3004
```

Caused by an unsupported feature in a media manifest. Examples of a media manifest are a DASH or a SmoothStreaming manifest, or an HLS playlist.

### ERROR_CODE_PERMISSION_DENIED

```
public static final int ERROR_CODE_PERMISSION_DENIED = -4
```

Caused by a command that is not allowed.

### ERROR_CODE_PREMIUM_ACCOUNT_REQUIRED

```
public static final int ERROR_CODE_PREMIUM_ACCOUNT_REQUIRED = -103
```

Caused by a premium account that is required but the user is not subscribed.

### ERROR_CODE_REMOTE_ERROR

```
public static final int ERROR_CODE_REMOTE_ERROR = 1001
```

Caused by an unidentified error in a remote Player, which is a Player that runs on a different host or process.

### ERROR_CODE_SETUP_REQUIRED

```
public static final int ERROR_CODE_SETUP_REQUIRED = -108
```

Caused by playback that needs manual user intervention.

### ERROR_CODE_SKIP_LIMIT_REACHED

```
public static final int ERROR_CODE_SKIP_LIMIT_REACHED = -107
```

Caused by the skip limit that is exhausted.

### ERROR_CODE_TIMEOUT

```
public static final int ERROR_CODE_TIMEOUT = 1003
```

Caused by a generic timeout.

### ERROR_CODE_UNSPECIFIED

```
public static final int ERROR_CODE_UNSPECIFIED = 1000
```

Caused by an error whose cause could not be identified.

### ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED

```
@UnstableApi
public static final int ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED = 7001
```

Caused by a failure when processing a video frame.

### ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED

```
@UnstableApi
public static final int ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED = 7000
```

Caused by a failure when initializing a `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor`.

### FIELD_CUSTOM_ID_BASE

```
@UnstableApi
protected static final int FIELD_CUSTOM_ID_BASE = 1000
```

Defines a minimum field ID value for subclasses to use when implementing `https://developer.android.com/reference/androidx/media3/common/PlaybackException#toBundle()` and delegating to `https://developer.android.com/reference/androidx/media3/common/PlaybackException#PlaybackException(android.os.Bundle)`.

Subclasses should obtain their `https://developer.android.com/reference/android/os/Bundle.html` field keys by applying a non-negative offset on this constant and passing the result to `https://developer.android.com/reference/androidx/media3/common/util/Util#intToStringMaxRadix(int)`.

## Public fields

### errorCode

```
@PlaybackException.ErrorCode
public final int errorCode
```

An error code which identifies the cause of the playback failure.

### extras

```
@UnstableApi
public final Bundle extras
```

An extras `https://developer.android.com/reference/android/os/Bundle.html`.

### timestampMs

```
public final long timestampMs
```

The value of `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when this exception was created.

## Public constructors

### PlaybackException

```
@UnstableApi
public PlaybackException(
    @Nullable String message,
    @Nullable Throwable cause,
    @PlaybackException.ErrorCode int errorCode
)
```

Creates an instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html message` | See `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Throwable.html cause` | See `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`. |
| `@https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode int errorCode` | A number which identifies the cause of the error. May be one of the `https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode`. |

### PlaybackException

```
@UnstableApi
public PlaybackException(
    @Nullable String message,
    @Nullable Throwable cause,
    @PlaybackException.ErrorCode int errorCode,
    Bundle extras
)
```

Creates an instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html message` | See `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Throwable.html cause` | See `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`. |
| `@https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode int errorCode` | A number which identifies the cause of the error. May be one of the `https://developer.android.com/reference/androidx/media3/common/PlaybackException.ErrorCode`. |
| `https://developer.android.com/reference/android/os/Bundle.html extras` | An optional `https://developer.android.com/reference/android/os/Bundle.html`. |

## Protected constructors

### PlaybackException

```
@UnstableApi
protected PlaybackException(Bundle bundle)
```

Creates a new instance using the fields obtained from the given `https://developer.android.com/reference/android/os/Bundle.html`.

### PlaybackException

```
@UnstableApi
protected PlaybackException(
    @Nullable String message,
    @Nullable Throwable cause,
    @PlaybackException.ErrorCode int errorCode,
    Bundle extras,
    long timestampMs
)
```

Creates a new instance using the given values.

## Public methods

### areErrorInfosEqual

```
@UnstableApi
public static boolean areErrorInfosEqual(
    @Nullable PlaybackException playbackException1,
    @Nullable PlaybackException playbackException2
)
```

Returns true if both `https://developer.android.com/reference/androidx/media3/common/PlaybackException` instances have `https://developer.android.com/reference/androidx/media3/common/PlaybackException#errorInfoEquals(androidx.media3.common.PlaybackException)` or both are null.

### errorInfoEquals

```
@CallSuper
public boolean errorInfoEquals(@Nullable PlaybackException other)
```

Returns whether the error data associated to this exception equals the error data associated to `other`.

Note that this method does not compare the exceptions' stack traces and `https://developer.android.com/reference/androidx/media3/common/PlaybackException#extras()`.

### fromBundle

```
@UnstableApi
public static PlaybackException fromBundle(Bundle bundle)
```

Restores a `PlaybackException` from a `https://developer.android.com/reference/android/os/Bundle.html`.

### getErrorCodeName

```
public final String getErrorCodeName()
```

Equivalent to `https://developer.android.com/reference/androidx/media3/common/PlaybackException#getErrorCodeName(int)`.

### getErrorCodeName

```
public static String getErrorCodeName(@PlaybackException.ErrorCode int errorCode)
```

Returns the name of a given `errorCode`.

### toBundle

```
@UnstableApi
@CallSuper
public Bundle toBundle()
```

Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this exception.