TouchTrackViewModel
class TouchTrackViewModel(mediaDuration: LiveData<Duration>, isSeekActionSupported: LiveData<Boolean>, viewModelCoroutineScope: CoroutineScope, launchSeekAction: (SeekAction) -> Unit)
View model for a touch track control used in MediaPlaybackViewModel.
Contains callbacks to support touch and tracking controls. Can be used with a TtSmoothSeekBar.
When mediaDuration is available and seeking is currently supported for the media being played, isSeekingAvailable will be true
, signaling that it is possible for the user to seek.
Parameters
mediaDuration
The media duration. Duration.ZERO if unknown or unavailable.
isSeekActionSupported
A LiveData set to true
when SeekAction is made available by current media source, and set to false
otherwise.
viewModelCoroutineScope
The ViewModel CoroutineScope.
launchSeekAction
Callback for launching a SeekAction with the new position.