From 404d65d7a491785ad07d78743f03544223d90cbd Mon Sep 17 00:00:00 2001 From: Mario Jr Date: Thu, 25 Feb 2021 15:36:11 -0300 Subject: [PATCH] Recover mute state for moderator when returning from breakout's audio transfer Fixes #11489 --- .../ui/components/audio/audio-controls/container.jsx | 5 +++++ .../imports/ui/components/audio/service.js | 6 ++++++ .../imports/ui/components/breakout-room/component.jsx | 2 ++ .../imports/ui/components/breakout-room/container.jsx | 2 ++ .../imports/ui/services/audio-manager/index.js | 10 ++++++++++ 5 files changed, 25 insertions(+) diff --git a/bigbluebutton-html5/imports/ui/components/audio/audio-controls/container.jsx b/bigbluebutton-html5/imports/ui/components/audio/audio-controls/container.jsx index e73416ede4..35123b9462 100755 --- a/bigbluebutton-html5/imports/ui/components/audio/audio-controls/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/audio-controls/container.jsx @@ -84,6 +84,11 @@ export default lockContextContainer(withModalMounter(withTracker(({ mountModal, const isViewer = currentUser.role === ROLE_VIEWER; const isPresenter = currentUser.presenter; + if (Service.isReturningFromBreakoutAudioTransfer()) { + Service.setReturningFromBreakoutAudioTransfer(false); + Service.recoverMicState(); + } + return ({ processToggleMuteFromOutside: arg => processToggleMuteFromOutside(arg), showMute: isConnected() && !isListenOnly() && !isEchoTest() && !userLocks.userMic, diff --git a/bigbluebutton-html5/imports/ui/components/audio/service.js b/bigbluebutton-html5/imports/ui/components/audio/service.js index 25f5159e91..b5caac4531 100755 --- a/bigbluebutton-html5/imports/ui/components/audio/service.js +++ b/bigbluebutton-html5/imports/ui/components/audio/service.js @@ -129,4 +129,10 @@ export default { playAlertSound: url => AudioManager.playAlertSound(url), updateAudioConstraints: constraints => AudioManager.updateAudioConstraints(constraints), + recoverMicState, + setReturningFromBreakoutAudioTransfer: (value) => { + AudioManager.returningFromBreakoutAudioTransfer = value; + }, + isReturningFromBreakoutAudioTransfer: + () => AudioManager.returningFromBreakoutAudioTransfer, }; diff --git a/bigbluebutton-html5/imports/ui/components/breakout-room/component.jsx b/bigbluebutton-html5/imports/ui/components/breakout-room/component.jsx index 0ba5df04cc..41b5b89864 100644 --- a/bigbluebutton-html5/imports/ui/components/breakout-room/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/breakout-room/component.jsx @@ -163,6 +163,7 @@ class BreakoutRoom extends PureComponent { intl, isUserInBreakoutRoom, exitAudio, + setReturningFromBreakoutAudioTransfer, } = this.props; const { @@ -176,6 +177,7 @@ class BreakoutRoom extends PureComponent { const disable = waiting && requestedBreakoutId !== breakoutId; const audioAction = joinedAudioOnly ? () => { + setReturningFromBreakoutAudioTransfer(true); this.returnBackToMeeeting(breakoutId); return logger.debug({ logCode: 'breakoutroom_return_main_audio', diff --git a/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx b/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx index 4cc8d07884..a118057d34 100644 --- a/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx @@ -25,6 +25,7 @@ export default withTracker((props) => { const breakoutRooms = findBreakouts(); const isMicrophoneUser = AudioService.isConnected() && !AudioService.isListenOnly(); const isMeteorConnected = Meteor.status().connected; + const { setReturningFromBreakoutAudioTransfer } = AudioService; return { ...props, @@ -41,5 +42,6 @@ export default withTracker((props) => { isMeteorConnected, isUserInBreakoutRoom, exitAudio: () => AudioManager.exitAudio(), + setReturningFromBreakoutAudioTransfer, }; })(BreakoutContainer); diff --git a/bigbluebutton-html5/imports/ui/services/audio-manager/index.js b/bigbluebutton-html5/imports/ui/services/audio-manager/index.js index f5c0208794..000d427a09 100755 --- a/bigbluebutton-html5/imports/ui/services/audio-manager/index.js +++ b/bigbluebutton-html5/imports/ui/services/audio-manager/index.js @@ -37,6 +37,8 @@ class AudioManager { tracker: new Tracker.Dependency(), }; + this._returningFromBreakoutAudioTransfer = false; + this.defineProperties({ isMuted: false, isConnected: false, @@ -523,6 +525,14 @@ class AudioManager { ? this.bridge.inputDeviceId : DEFAULT_INPUT_DEVICE_ID; } + get returningFromBreakoutAudioTransfer() { + return this._returningFromBreakoutAudioTransfer; + } + + set returningFromBreakoutAudioTransfer(value) { + this._returningFromBreakoutAudioTransfer = value; + } + set userData(value) { this._userData = value; }