Skip to content

Pause voice broadcast listening on new VB recording #7973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7830.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pause voice broadcast listening on new VB recording
Original file line number Diff line number Diff line change
Expand Up @@ -626,13 +626,17 @@ class TimelineViewModel @AssistedInject constructor(
viewModelScope.launch {
when (action) {
VoiceBroadcastAction.Recording.Start -> {
voiceBroadcastHelper.pausePlayback()
Copy link
Contributor

@Florian14 Florian14 Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it would have been better to do this in StartVoiceBroadcastUseCase.startVoiceBroadcast (after checking if the user is allowed to start a VB). wdyt? It will introduce a circular DI issue, seems good like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to do that I need to inject the VoiceBroadcastHelper in StartVoiceBroadcastUseCase but StartVoiceBroadcastUseCase is already inject in VoiceBroadcastHelper

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

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)
Expand Down