# MediaPlaybackManager

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/media/MediaPlaybackManager.java+class:androidx.car.app.media.MediaPlaybackManager) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.4.0)

*** ** * ** ***


```
@RequiresCarApi(value = 8)
class MediaPlaybackManager : Manager
```

<br />

*** ** * ** ***

Manager for communicating Media Session Token the host.

Apps must use this interface to coordinate with the car system to allow media playback.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/car/app/media/MediaPlaybackManager#registerMediaPlaybackToken(android.support.v4.media.session.MediaSessionCompat.Token)(token: https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat.Token)` Sends a media session token to the host in order to allow the host to read the media session playback state. |

## Public functions

### registerMediaPlaybackToken

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.4.0)

```
@MainThread
fun registerMediaPlaybackToken(token: MediaSessionCompat.Token): Unit
```

Sends a media session token to the host in order to allow the host to read the media session playback state.

| Parameters |
|---|---|
| `token: https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat.Token` | to be sent to the host |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if any of the token cannot be serialized |
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if this is not called from the main thread. |