# MediaItem.DrmConfiguration

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

*** ** * ** ***

<br />

```
class MediaItem.DrmConfiguration
```

<br />

*** ** * ** ***

DRM configuration for a media item.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration.Builder!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#buildUpon()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration.Builder` initialized with the values of this instance. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html!)` Restores a `DrmConfiguration` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#hashCode()()` |
| `https://developer.android.com/reference/android/os/Bundle.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#toBundle()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#forceDefaultLicenseUri()` Whether to force use of `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#licenseUri()` even if the media specifies its own DRM license server URI. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#forcedSessionTrackTypes()` The types of tracks for which to always use a DRM session even if the content is unencrypted. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>?` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#keySetId()` |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#licenseRequestHeaders()` The headers to attach to requests sent to the DRM license server. |
| `https://developer.android.com/reference/android/net/Uri.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#licenseUri()` Optional default DRM license server `https://developer.android.com/reference/android/net/Uri.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#multiSession()` Whether the DRM configuration is multi session enabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#playClearContentWithoutKey()` Whether clear samples within protected content should be played when keys for the encrypted part of the content have yet to be loaded. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#requestHeaders()` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#licenseRequestHeaders()` instead. <br /> |
| `https://developer.android.com/reference/java/util/UUID.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#scheme()` The UUID of the protection scheme. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#sessionForClearTypes()` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#forcedSessionTrackTypes()`. <br /> |
| `https://developer.android.com/reference/java/util/UUID.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#uuid()` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#scheme()` instead. <br /> |

## Public functions

### buildUpon

```
fun buildUpon(): MediaItem.DrmConfiguration.Builder!
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration.Builder` initialized with the values of this instance.

### equals

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

### fromBundle

```
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): MediaItem.DrmConfiguration!
```

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

### hashCode

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

### toBundle

```
@UnstableApi
fun toBundle(): Bundle!
```

## Public properties

### forceDefaultLicenseUri

```
val forceDefaultLicenseUri: Boolean
```

Whether to force use of `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#licenseUri()` even if the media specifies its own DRM license server URI.

### forcedSessionTrackTypes

```
val forcedSessionTrackTypes: ImmutableList<Int!>!
```

The types of tracks for which to always use a DRM session even if the content is unencrypted.

### keySetId

```
val keySetId: Array<Byte>?
```

### licenseRequestHeaders

```
val licenseRequestHeaders: ImmutableMap<String!, String!>!
```

The headers to attach to requests sent to the DRM license server.

### licenseUri

```
val licenseUri: Uri?
```

Optional default DRM license server `https://developer.android.com/reference/android/net/Uri.html`. If `null` then the DRM license server must be specified by the media.

### multiSession

```
val multiSession: Boolean
```

Whether the DRM configuration is multi session enabled.

### playClearContentWithoutKey

```
val playClearContentWithoutKey: Boolean
```

Whether clear samples within protected content should be played when keys for the encrypted part of the content have yet to be loaded.

### requestHeaders

```
@UnstableApi
val requestHeaders: ImmutableMap<String!, String!>!
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#licenseRequestHeaders()` instead.

### scheme

```
val scheme: UUID!
```

The UUID of the protection scheme.

### sessionForClearTypes

```
@UnstableApi
val sessionForClearTypes: ImmutableList<Int!>!
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#forcedSessionTrackTypes()`.

### uuid

```
@UnstableApi
val uuid: UUID!
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem.DrmConfiguration#scheme()` instead.