# MediaControllerCompat.TransportControls

Artifact: [androidx.media:media](https://developer.android.com/jetpack/androidx/releases/media) [View Source](https://cs.android.com/search?q=file:android/support/v4/media/session/MediaControllerCompat.java+class:android.support.v4.media.session.MediaControllerCompat.TransportControls) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

*** ** * ** ***


```
abstract class MediaControllerCompat.TransportControls
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> androidx.media is deprecated. Please migrate to [androidx.media3](https://developer.android.com/media/media3).

Interface for controlling media playback on a session. This allows an app to send media transport commands to the session.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#EXTRA_LEGACY_STREAM_TYPE() = "android.media.session.extra.LEGACY_STREAM_TYPE"` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE()` instead. <br /> |

| ### Public functions |
|---|---|
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[fastForward](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#fastForward())()` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[pause](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#pause())()` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[play](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#play())()` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[playFromMediaId](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromMediaId(java.lang.String,android.os.Bundle))(mediaId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[playFromSearch](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromSearch(java.lang.String,android.os.Bundle))(query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[playFromUri](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromUri(android.net.Uri,android.os.Bundle))(uri: https://developer.android.com/reference/android/net/Uri.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[prepare](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepare())()` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[prepareFromMediaId](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepareFromMediaId(java.lang.String,android.os.Bundle))(mediaId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[prepareFromSearch](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepareFromSearch(java.lang.String,android.os.Bundle))(query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[prepareFromUri](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepareFromUri(android.net.Uri,android.os.Bundle))(uri: https://developer.android.com/reference/android/net/Uri.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[rewind](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#rewind())()` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[seekTo](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#seekTo(long))(pos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[sendCustomAction](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#sendCustomAction(java.lang.String,android.os.Bundle))(action: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, args: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[sendCustomAction](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#sendCustomAction(android.support.v4.media.session.PlaybackStateCompat.CustomAction,android.os.Bundle))( customAction: https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction!, args: https://developer.android.com/reference/android/os/Bundle.html! )` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setCaptioningEnabled](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setCaptioningEnabled(boolean))(enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setPlaybackSpeed](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setPlaybackSpeed(float))(speed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setRating](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setRating(android.support.v4.media.RatingCompat))(rating: https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setRating](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setRating(android.support.v4.media.RatingCompat,android.os.Bundle))(rating: https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setRepeatMode](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setRepeatMode(int))(repeatMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[setShuffleMode](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setShuffleMode(int))(shuffleMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[skipToNext](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#skipToNext())()` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[skipToPrevious](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#skipToPrevious())()` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[skipToQueueItem](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#skipToQueueItem(long))(id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` **This function is deprecated.** Deprecated in Java |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[stop](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#stop())()` **This function is deprecated.** Deprecated in Java |

## Constants

### EXTRA_LEGACY_STREAM_TYPE

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.4.0](https://developer.android.com/jetpack/androidx/releases/media#1.4.0)

```
const val EXTRA_LEGACY_STREAM_TYPE = "android.media.session.extra.LEGACY_STREAM_TYPE": String!
```

> [!CAUTION]
> **This property is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#TRANSPORT_CONTROLS_EXTRAS_KEY_LEGACY_STREAM_TYPE()` instead.

Used as an integer extra field in `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromMediaId(java.lang.String,android.os.Bundle)` or `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepareFromMediaId(java.lang.String,android.os.Bundle)` to indicate the stream type to be used by the media player when playing or preparing the specified media id. See `https://developer.android.com/reference/android/media/AudioManager.html` for a list of stream types.

## Public functions

### fastForward

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [fastForward](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#fastForward())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Starts fast forwarding. If playback is already fast forwarding this may increase the rate.

### pause

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [pause](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#pause())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player pause its playback and stay at its current position.

### play

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [play](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#play())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player start its playback at its current position.

### playFromMediaId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [playFromMediaId](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromMediaId(java.lang.String,android.os.Bundle))(mediaId: String!, extras: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player start playback for a specific media id.

| Parameters |
|---|---|
| `mediaId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The id of the requested media. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional extras that can include extra information about the media item to be played. |

### playFromSearch

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [playFromSearch](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromSearch(java.lang.String,android.os.Bundle))(query: String!, extras: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player start playback for a specific search query. An empty or null query should be treated as a request to play any music.

| Parameters |
|---|---|
| `query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The search query. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional extras that can include extra information about the query. |

### playFromUri

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [playFromUri](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromUri(android.net.Uri,android.os.Bundle))(uri: Uri!, extras: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player start playback for a specific `https://developer.android.com/reference/android/net/Uri.html`.

| Parameters |
|---|---|
| `uri: https://developer.android.com/reference/android/net/Uri.html!` | The URI of the requested media. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional extras that can include extra information about the media item to be played. |

### prepare

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [prepare](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepare())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player prepare for playback. This can decrease the time it takes to start playback when a play command is received. Preparation is not required. You can call `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#play()` without calling this method beforehand.

### prepareFromMediaId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [prepareFromMediaId](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepareFromMediaId(java.lang.String,android.os.Bundle))(mediaId: String!, extras: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player prepare playback for a specific media id. This can decrease the time it takes to start playback when a play command is received. Preparation is not required. You can call `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromMediaId(java.lang.String,android.os.Bundle)` without calling this method beforehand.

| Parameters |
|---|---|
| `mediaId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The id of the requested media. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional extras that can include extra information about the media item to be prepared. |

### prepareFromSearch

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [prepareFromSearch](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepareFromSearch(java.lang.String,android.os.Bundle))(query: String!, extras: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player prepare playback for a specific search query. This can decrease the time it takes to start playback when a play command is received. An empty or null query should be treated as a request to prepare any music. Preparation is not required. You can call `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromSearch(java.lang.String,android.os.Bundle)` without calling this method beforehand.

| Parameters |
|---|---|
| `query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The search query. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional extras that can include extra information about the query. |

### prepareFromUri

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [prepareFromUri](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#prepareFromUri(android.net.Uri,android.os.Bundle))(uri: Uri!, extras: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player prepare playback for a specific `https://developer.android.com/reference/android/net/Uri.html`. This can decrease the time it takes to start playback when a play command is received. Preparation is not required. You can call `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#playFromUri(android.net.Uri,android.os.Bundle)` without calling this method beforehand.

| Parameters |
|---|---|
| `uri: https://developer.android.com/reference/android/net/Uri.html!` | The URI of the requested media. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional extras that can include extra information about the media item to be prepared. |

### rewind

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [rewind](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#rewind())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Starts rewinding. If playback is already rewinding this may increase the rate.

### seekTo

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [seekTo](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#seekTo(long))(pos: Long): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Moves to a new location in the media stream.

| Parameters |
|---|---|
| `pos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | Position to move to, in milliseconds. |

### sendCustomAction

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [sendCustomAction](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#sendCustomAction(java.lang.String,android.os.Bundle))(action: String!, args: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sends the id and args from a custom action for the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat` to perform.

| Parameters |
|---|---|
| `action: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The action identifier of the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction` as specified by the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat`. |
| `args: https://developer.android.com/reference/android/os/Bundle.html!` | Optional arguments to supply to the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat` for this custom action. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#sendCustomAction(android.support.v4.media.session.PlaybackStateCompat.CustomAction,android.os.Bundle)` |   |
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat#ACTION_FLAG_AS_INAPPROPRIATE()` |   |
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat#ACTION_SKIP_AD()` |   |
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat#ACTION_FOLLOW()` |   |
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat#ACTION_UNFOLLOW()` |   |

### sendCustomAction

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [sendCustomAction](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#sendCustomAction(android.support.v4.media.session.PlaybackStateCompat.CustomAction,android.os.Bundle))(
    customAction: PlaybackStateCompat.CustomAction!,
    args: Bundle!
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sends a custom action for the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat` to perform.

| Parameters |
|---|---|
| `customAction: https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction!` | The action to perform. |
| `args: https://developer.android.com/reference/android/os/Bundle.html!` | Optional arguments to supply to the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat` for this custom action. |

### setCaptioningEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [setCaptioningEnabled](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setCaptioningEnabled(boolean))(enabled: Boolean): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Enables/disables captioning for this session.

| Parameters |
|---|---|
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` to enable captioning, `false` to disable. |

### setPlaybackSpeed

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/media#1.2.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [setPlaybackSpeed](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setPlaybackSpeed(float))(speed: Float): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the playback speed. A value of `1.0f` is the default playback value, and a negative value indicates reverse playback. `0.0f` is not allowed.

| Parameters |
|---|---|
| `speed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The playback speed |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the `speed` is equal to zero. |

### setRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [setRating](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setRating(android.support.v4.media.RatingCompat))(rating: RatingCompat!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Rates the current content. This will cause the rating to be set for the current user. The rating type of the given `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat` must match the type returned by `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat#getRatingType()`.

| Parameters |
|---|---|
| `rating: https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | The rating to set for the current content |

### setRating

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [setRating](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setRating(android.support.v4.media.RatingCompat,android.os.Bundle))(rating: RatingCompat!, extras: Bundle!): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Rates a media item. This will cause the rating to be set for the specific media item. The rating type of the given `https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat` must match the type returned by `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat#getRatingType()`.

| Parameters |
|---|---|
| `rating: https://developer.android.com/reference/kotlin/android/support/v4/media/RatingCompat!` | The rating to set for the media item. |
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional arguments that can include information about the media item to be rated. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat#ARGUMENT_MEDIA_ATTRIBUTE()` |   |
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat#ARGUMENT_MEDIA_ATTRIBUTE_VALUE()` |   |

### setRepeatMode

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [setRepeatMode](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setRepeatMode(int))(repeatMode: Int): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the repeat mode for this session.

| Parameters |
|---|---|
| `repeatMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The repeat mode. Must be one of the followings: `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_NONE()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_ONE()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_ALL()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_GROUP()` |

### setShuffleMode

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [setShuffleMode](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#setShuffleMode(int))(shuffleMode: Int): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the shuffle mode for this session.

| Parameters |
|---|---|
| `shuffleMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The shuffle mode. Must be one of the followings: `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat#SHUFFLE_MODE_NONE()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat#SHUFFLE_MODE_ALL()`, `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat#SHUFFLE_MODE_GROUP()` |

### skipToNext

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [skipToNext](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#skipToNext())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Skips to the next item.

### skipToPrevious

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [skipToPrevious](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#skipToPrevious())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Skips to the previous item.

### skipToQueueItem

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [skipToQueueItem](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#skipToQueueItem(long))(id: Long): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Plays an item with a specific id in the play queue. If you specify an id that is not in the play queue, the behavior is undefined.

### stop

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
abstract fun [stop](https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat.TransportControls#stop())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Request that the player stop its playback; it may clear its state in whatever way is appropriate.