# PlayPauseButton

## Functions summary

|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/buttons/PlayPauseButton.composable#PlayPauseButton(androidx.media3.common.Player,kotlin.Int,kotlin.Function1)( player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?, displayMode: @https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/DisplayMode https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayPauseButtonState.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` A state container for a button that plays or pauses the media item. |

## Functions

### PlayPauseButton

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/buttons/PlayPauseButton.kt+function:PlayPauseButton)

```
@UnstableApi
@Composable
fun PlayPauseButton(
    player: Player?,
    displayMode: @DisplayMode Int = SHOW_BUFFERING_ALWAYS or SHOW_REPLAY_ON_ENDED or SHOW_RETRY_ON_ERROR,
    content: @Composable PlayPauseButtonState.() -> Unit
): Unit
```

A state container for a button that plays or pauses the media item.

This composable manages the enabled state and click handling of a play-pause button. The UI is provided by the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/buttons/package-summary#PlayPauseButton(androidx.media3.common.Player,kotlin.Int,kotlin.Function1)` lambda, which has access to the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayPauseButtonState`.

| Parameters |
|---|---|
| `player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` to control. |
| `displayMode: @https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/DisplayMode https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = SHOW_BUFFERING_ALWAYS or SHOW_REPLAY_ON_ENDED or SHOW_RETRY_ON_ERROR` | The `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/DisplayMode` determining under which conditions buffering, replay, or retry indicators should be shown. Defaults to `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#SHOW_BUFFERING_ALWAYS()` combined with `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#SHOW_REPLAY_ON_ENDED()` and `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#SHOW_RETRY_ON_ERROR()`. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayPauseButtonState.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The composable content to be displayed for the button. |