Playback Controls
Observing if the video is playing
Note: The camera should have already started streaming LiveView before making any interactions
To observe the video is currently playing, The following can be used:
viewModelScope.launch {
client.isPlaying.collectLatest { isPlaying ->
// isPlaying will be set to true if the video is currently in play state.
}
}
Observing Current Playback Time
Note: The camera should have already started streaming LiveView before making any interactions
To observe the current playback time, The following can be used:
viewModelScope.launch {
client.currentTime.collectLatest { time ->
// This will trigger every seconds to indicate the new time.
}
}
Seeking to a specific time
Note: The camera should have already started streaming LiveView before making any interactions
To seek to a specific time, The following can be used:
client.seek(
start = 123123123L,
end = 123123123L
)
Resume playback
Note: The camera should have already started streaming LiveView before making any interactions
To resume playback, The following can be used:
client.play()
Pause playback
Note: The camera should have already started streaming LiveView before making any interactions
To Pause playback, The following can be used:
client.pause()