@UnstableApi
class MuteButtonState


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

Summary

Public constructors

Public functions

suspend Unit

Subscribes to updates from Player.Events and listens to

Unit

Handles the interaction with the Mute button according to the current state of the Player.

Public properties

Boolean

true if player is not null and commands Player.COMMAND_SET_VOLUME and Player.COMMAND_GET_VOLUME are available.

Boolean

true if player is not null and player's volume is 0.0f.

Public constructors

MuteButtonState

MuteButtonState(player: Player?)

Public functions

observe

suspend fun observe(): Unit

Subscribes to updates from Player.Events and listens to

onClick

fun onClick(): Unit

Handles the interaction with the Mute button according to the current state of the Player. Toggled between a muted state (volume of the Player is 0) and non-muted. Does not influence the volume of the device.

This method does nothing if Player.COMMAND_SET_VOLUME is not available.

Public properties

isEnabled

val isEnabledBoolean

true if player is not null and commands Player.COMMAND_SET_VOLUME and Player.COMMAND_GET_VOLUME are available.

showMuted

val showMutedBoolean

true if player is not null and player's volume is 0.0f.