From ec48b1ec2d7b2a3a095a4fadf906c57fd45ef7ac Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 19 Oct 2017 15:51:58 +0100 Subject: [PATCH 1/2] Display join audio window if back from breakout room. --- .../src/org/bigbluebutton/core/model/Me.as | 5 +++-- .../bigbluebutton/main/model/users/BreakoutRoom.as | 9 +++++++++ .../modules/users/services/MessageReceiver.as | 7 +++++++ .../modules/users/views/JoinBreakoutRoomWindow.mxml | 11 +++++++++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as b/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as index 9324ab8d6c..ff3b9a979b 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as @@ -52,7 +52,8 @@ package org.bigbluebutton.core.model public var authTokenValid: Boolean = false; public var waitingForApproval: Boolean; - + public var breakoutEjectFromAudio : Boolean = false; + private var _role:String = "viewer"; public function get role():String { return _role.toUpperCase(); @@ -84,7 +85,7 @@ package org.bigbluebutton.core.model public function myCamSettings():ArrayCollection { return _myCamSettings; } - + public function applyLockSettings():void { var lockSettings:LockSettingsVO = UsersUtil.getLockSettings(); var amNotModerator:Boolean = !UsersUtil.amIModerator(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as index 21516c08fd..04aa659826 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as @@ -61,6 +61,15 @@ package org.bigbluebutton.main.model.users { removeUser(user.id); users.addItem(user); } + + public function hasUserWithId(userId:String) : Boolean { + for (var i : int = 0; i < users.length; i++) { + if (BreakoutUser(users.getItemAt(i)).id.indexOf(userId) > -1 ) { + return true; + } + } + return false; + } public function removeUser(id: String): void { for (var i: int = 0; i < users.length; i++) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as index 1f3c57fd83..639ae1a979 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as @@ -51,6 +51,7 @@ package org.bigbluebutton.modules.users.services import org.bigbluebutton.main.model.users.events.ChangeMyRole; import org.bigbluebutton.main.model.users.events.StreamStartedEvent; import org.bigbluebutton.main.model.users.events.StreamStoppedEvent; + import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent; import org.bigbluebutton.modules.screenshare.events.WebRTCViewStreamEvent; import org.bigbluebutton.modules.users.events.MeetingMutedEvent; @@ -810,6 +811,12 @@ package org.bigbluebutton.modules.users.services var body: Object = msg.body as Object; var breakoutId: String = body.breakoutId as String; + // Display audio join window + if (LiveMeeting.inst().me.breakoutEjectFromAudio && LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId).hasUserWithId(LiveMeeting.inst().me.id)) { + LiveMeeting.inst().me.breakoutEjectFromAudio = false; + dispatcher.dispatchEvent(new AudioSelectionWindowEvent(AudioSelectionWindowEvent.SHOW_AUDIO_SELECTION)); + } + switchUserFromBreakoutToMainVoiceConf(breakoutId); var breakoutRoom: BreakoutRoom = LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId); LiveMeeting.inst().breakoutRooms.removeBreakoutRoom(breakoutId); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml index 1e68d2f5e3..9d0ade9e05 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml @@ -31,10 +31,11 @@ with BigBlueButton; if not, see . . } protected function joinButtonClickHandler(event:MouseEvent):void { + if (LiveMeeting.inst().me.inVoiceConf) { + LiveMeeting.inst().me.breakoutEjectFromAudio = true; + } else { + LiveMeeting.inst().me.breakoutEjectFromAudio = false; + + } dispatcher.dispatchEvent(new LeaveVoiceConferenceCommand()); dispatcher.dispatchEvent(new StopBroadcastEvent()); navigateToURL(new URLRequest(this.joinUrl), "_blank"); From b447d18b04feffe9b1c111d7fb2d3f9d3d366e5e Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 19 Oct 2017 15:59:01 +0100 Subject: [PATCH 2/2] Invalidate 'breakoutEjectFromAudio' state if the join audio button is pressed. --- .../org/bigbluebutton/main/views/MainApplicationShell.mxml | 2 +- .../modules/phone/views/components/ToolbarButton.mxml | 1 + .../bigbluebutton/modules/users/services/MessageReceiver.as | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index b4af325d64..587fe449a9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -150,10 +150,10 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent; import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent; import org.bigbluebutton.modules.phone.models.PhoneOptions; - import org.bigbluebutton.util.browser.BrowserCheck; import org.bigbluebutton.modules.users.model.UsersOptions; import org.bigbluebutton.modules.users.views.BreakoutRoomSettings; import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent; + import org.bigbluebutton.util.browser.BrowserCheck; import org.bigbluebutton.util.i18n.ResourceUtil; private static const LOGGER:ILogger = getClassLogger(MainApplicationShell); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 39b716c527..f811c5ac01 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -113,6 +113,7 @@ with BigBlueButton; if not, see . } private function joinAudio():void { + LiveMeeting.inst().me.breakoutEjectFromAudio = false; if (phoneOptions.skipCheck || disableMyMic || defaultListenOnlyMode) { var command:JoinVoiceConferenceCommand = new JoinVoiceConferenceCommand(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as index 639ae1a979..1100f5c2ca 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as @@ -812,7 +812,10 @@ package org.bigbluebutton.modules.users.services var breakoutId: String = body.breakoutId as String; // Display audio join window - if (LiveMeeting.inst().me.breakoutEjectFromAudio && LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId).hasUserWithId(LiveMeeting.inst().me.id)) { + if (LiveMeeting.inst().me.breakoutEjectFromAudio && + LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId).hasUserWithId(LiveMeeting.inst().me.id) && + !LiveMeeting.inst().me.inVoiceConf + ) { LiveMeeting.inst().me.breakoutEjectFromAudio = false; dispatcher.dispatchEvent(new AudioSelectionWindowEvent(AudioSelectionWindowEvent.SHOW_AUDIO_SELECTION)); }