Pause voice broadcast listening on new VB recording

This commit is contained in:
yostyle 2023-01-19 01:14:48 +01:00
parent 0cdbceaa00
commit 64d116d4ac
2 changed files with 6 additions and 1 deletions

1
changelog.d/7830.misc Normal file
View File

@ -0,0 +1 @@
Pause voice broadcast listening on new VB recording

View File

@ -626,13 +626,17 @@ class TimelineViewModel @AssistedInject constructor(
viewModelScope.launch {
when (action) {
VoiceBroadcastAction.Recording.Start -> {
voiceBroadcastHelper.pausePlayback()
voiceBroadcastHelper.startVoiceBroadcast(room.roomId).fold(
{ _viewEvents.post(RoomDetailViewEvents.ActionSuccess(action)) },
{ _viewEvents.post(RoomDetailViewEvents.ActionFailure(action, it)) },
)
}
VoiceBroadcastAction.Recording.Pause -> voiceBroadcastHelper.pauseVoiceBroadcast(room.roomId)
VoiceBroadcastAction.Recording.Resume -> voiceBroadcastHelper.resumeVoiceBroadcast(room.roomId)
VoiceBroadcastAction.Recording.Resume -> {
voiceBroadcastHelper.pausePlayback()
voiceBroadcastHelper.resumeVoiceBroadcast(room.roomId)
}
VoiceBroadcastAction.Recording.Stop -> _viewEvents.post(RoomDetailViewEvents.DisplayPromptToStopVoiceBroadcast)
VoiceBroadcastAction.Recording.StopConfirmed -> voiceBroadcastHelper.stopVoiceBroadcast(room.roomId)
is VoiceBroadcastAction.Listening.PlayOrResume -> voiceBroadcastHelper.playOrResumePlayback(action.voiceBroadcast)