# UnsupportedDrmException

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

*** ** * ** ***


```
@UnstableApi
public final class UnsupportedDrmException 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.exoplayer.drm.UnsupportedDrmException](https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException) |

*** ** * ** ***

Thrown when the requested DRM scheme is not supported.

## 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(value = ) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException.Reason` The reason for the exception. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_INSTANTIATION_ERROR() = 2` There device advertises support for the requested DRM scheme, but there was an error instantiating it. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_UNSUPPORTED_SCHEME() = 1` The requested DRM scheme is unsupported by the device. |

| ### Public fields |
|---|---|
| `final int` | `@https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException.Reason https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#reason()` Either `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_UNSUPPORTED_SCHEME()` or `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_INSTANTIATION_ERROR()`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#UnsupportedDrmException(int)(@https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException.Reason int reason)` |
| `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#UnsupportedDrmException(int,java.lang.Exception)( @https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException.Reason int reason, https://developer.android.com/reference/java/lang/Exception.html cause )` |

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

### REASON_INSTANTIATION_ERROR

```
public static final int REASON_INSTANTIATION_ERROR = 2
```

There device advertises support for the requested DRM scheme, but there was an error instantiating it. The cause can be retrieved using `https://developer.android.com/reference/java/lang/Throwable.html#getCause()`.

### REASON_UNSUPPORTED_SCHEME

```
public static final int REASON_UNSUPPORTED_SCHEME = 1
```

The requested DRM scheme is unsupported by the device.

## Public fields

### reason

```
@UnsupportedDrmException.Reason
public final int reason
```

Either `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_UNSUPPORTED_SCHEME()` or `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_INSTANTIATION_ERROR()`.

## Public constructors

### UnsupportedDrmException

```
public UnsupportedDrmException(@UnsupportedDrmException.Reason int reason)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException.Reason int reason` | `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_UNSUPPORTED_SCHEME()` or `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_INSTANTIATION_ERROR()`. |

### UnsupportedDrmException

```
public UnsupportedDrmException(
    @UnsupportedDrmException.Reason int reason,
    Exception cause
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException.Reason int reason` | `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_UNSUPPORTED_SCHEME()` or `https://developer.android.com/reference/androidx/media3/exoplayer/drm/UnsupportedDrmException#REASON_INSTANTIATION_ERROR()`. |
| `https://developer.android.com/reference/java/lang/Exception.html cause` | The cause of this exception. |