-
public final class AudioPlayerViewModel extends ViewModel
ViewModel class for the AudioPlayer.
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<AudioPlayerState>state
-
Constructor Summary
Constructors Constructor Description AudioPlayerViewModel(AudioPlayerController controller)
-
Method Summary
Modifier and Type Method Description final StateFlow<AudioPlayerState>getState()State of the audio player. final UnitplayOrPause(Attachment attachment)Play or pause the audio. final Unitpause()Pause any running audio. final UnitchangeSpeed(Attachment attachment)Change the speed of the audio. final UnitseekTo(Attachment attachment, Float progress)Seek to a specific progress in the audio. final UnitstartSeek(Attachment attachment)Start seeking the audio. final Unitreset(Attachment attachment)Stop seeking the audio. -
-
Method Detail
-
getState
final StateFlow<AudioPlayerState> getState()
State of the audio player.
-
playOrPause
final Unit playOrPause(Attachment attachment)
Play or pause the audio.
-
changeSpeed
final Unit changeSpeed(Attachment attachment)
Change the speed of the audio.
-
seekTo
final Unit seekTo(Attachment attachment, Float progress)
Seek to a specific progress in the audio.
-
-
-
-