# SeekForwardButtonState

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/state/SeekForwardButtonState.kt+class:androidx.media3.ui.compose.state.SeekForwardButtonState)

<br />

```
@UnstableApi
class SeekForwardButtonState
```

<br />

*** ** * ** ***

State that holds all interactions to correctly deal with a UI component representing a seek forward button.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#SeekForwardButtonState(androidx.media3.common.Player)(player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?)` |

| ### Public functions |
|---|---|
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#observe()()` Subscribes to updates from `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events` and listens to |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#onClick()()` Handles the interaction with the SeekForwardButton by seeking forward in the current `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` by `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#seekForwardAmountMs()` milliseconds. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#isEnabled()` true if `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#player()` is not `null` and `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#COMMAND_SEEK_FORWARD()` is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#seekForwardAmountMs()` determined by `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getSeekForwardIncrement()`. |

## Public constructors

### SeekForwardButtonState

```
SeekForwardButtonState(player: Player?)
```

## Public functions

### observe

```
suspend fun observe(): Unit
```

Subscribes to updates from `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events` and listens to

- `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#EVENT_AVAILABLE_COMMANDS_CHANGED()` in order to determine whether the button should be enabled, i.e. respond to user input.

- `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#EVENT_SEEK_FORWARD_INCREMENT_CHANGED()` to get the newest seek forward increment.

### onClick

```
fun onClick(): Unit
```

Handles the interaction with the SeekForwardButton by seeking forward in the current `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` by `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#seekForwardAmountMs()` milliseconds.

This method does nothing if `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#COMMAND_SEEK_FORWARD()` is not available.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekForward()` |   |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#COMMAND_SEEK_FORWARD()` |   |

## Public properties

### isEnabled

```
val isEnabled: Boolean
```

true if `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#player()` is not `null` and `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#COMMAND_SEEK_FORWARD()` is available.

### seekForwardAmountMs

```
val seekForwardAmountMs: Long
```

determined by `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getSeekForwardIncrement()`. Defaults to `0` if `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState#player()` is `null`.