# MediaDrm.PlaybackComponent

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# PlaybackComponent

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/MediaDrm.PlaybackComponent "View this page in Java")  

```
class PlaybackComponent
```

|---|--------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                       ||
| ↳ | [android.media.MediaDrm.PlaybackComponent](https://developer.android.com/reference/kotlin/android/media/MediaDrm.PlaybackComponent#) |

This class contains the Drm session ID and log session ID

## Summary

|                                                                                                                                                                                                                                           Public methods                                                                                                                                                                                                                                            ||
|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId) | [getLogSessionId](https://developer.android.com/reference/kotlin/android/media/MediaDrm.PlaybackComponent#getLogSessionId())`()` Returns the[LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId).                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                      | [setLogSessionId](https://developer.android.com/reference/kotlin/android/media/MediaDrm.PlaybackComponent#setLogSessionId(android.media.metrics.LogSessionId))`(`logSessionId:` `[LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId)`)` Sets the[LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId). |

## Public methods

### getLogSessionId

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getLogSessionId(): LogSessionId
```

Returns the[LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId).

|                                                             Return                                                             ||
|---------------------------------------------------------------------------------------------------|-----------------------------|
| [LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId) | This value cannot be`null`. |

### setLogSessionId

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setLogSessionId(logSessionId: LogSessionId): Unit
```

Sets the[LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId).

The implementation of this method varies by DRM provider; Please refer to your DRM provider documentation for more details on this method.

|                                                                  Parameters                                                                   ||
|----------------|-------------------------------------------------------------------------------------------------------------------------------|
| `logSessionId` | [LogSessionId](https://developer.android.com/reference/kotlin/android/media/metrics/LogSessionId):This value cannot be`null`. |

|                                            Exceptions                                            ||
|-------------------------------------------|-------------------------------------------------------|
| `java.lang.UnsupportedOperationException` | when the vendor plugin does not implement this method |