NextButtonState
@UnstableApi
class NextButtonState
State that holds all interactions to correctly deal with a UI component representing a seek-to-next button.
This button has no internal state to maintain, it can only be enabled or disabled.
Summary
Public constructors |
|---|
NextButtonState(player: Player?) |
Public functions |
|
|---|---|
suspend Unit |
observe()Subscribes to updates from |
Unit |
onClick()Handles the interaction with the NextButton by seeking to the next MediaItem, if available, or to later position in the current MediaItem, if live. |
Public properties |
|
|---|---|
Boolean |
true if |
Public constructors
Public functions
observe
suspend fun observe(): Unit
Subscribes to updates from Player.Events and listens to Player.EVENT_AVAILABLE_COMMANDS_CHANGED in order to determine whether the button should be enabled, i.e. respond to user input.
onClick
fun onClick(): Unit
Handles the interaction with the NextButton by seeking to the next MediaItem, if available, or to later position in the current MediaItem, if live.
This method does nothing if Player.COMMAND_SEEK_TO_NEXT is not available.
| See also | |
|---|---|
seekToNext |
|
COMMAND_SEEK_TO_NEXT |
Public properties
isEnabled
val isEnabled: Boolean
true if player is not null and Player.COMMAND_SEEK_TO_NEXT is available.