Skip to content

Commit 2bc57e9

Browse files
committed
added mute all except presenter and removed presenter from sort function
1 parent 1c7a060 commit 2bc57e9

File tree

8 files changed

+77
-13
lines changed

8 files changed

+77
-13
lines changed

bigbluebutton-client/src/org/bigbluebutton/main/model/users/BBBUser.as

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ package org.bigbluebutton.main.model.users
8484
[Bindable] public var room:String = "";
8585
[Bindable] public var authToken:String = "";
8686
[Bindable] public var selected:Boolean = false;
87-
[Bindable] public var voiceUserid:Number;
87+
[Bindable] public var voiceUserid:Number = 0;
8888

8989
private var _voiceMuted:Boolean = false;
9090
[Bindable]
@@ -219,14 +219,23 @@ package org.bigbluebutton.main.model.users
219219
n.authToken = user.authToken;
220220
n.me = user.me;
221221
n.userID = user.userID;
222-
n.externUserID = user.externUserID;
222+
n.externUserID = user.externUserID;
223223
n.name = user.name;
224224
n.hasStream = user.hasStream;
225225
n.streamName = user.streamName;
226226
n.presenter = user.presenter;
227227
n.raiseHand = user.raiseHand;
228228
n.role = user.role;
229229
n.room = user.room;
230+
n.customdata = user.customdata;
231+
n.media = user.media;
232+
n.phoneUser = user.phoneUser;
233+
n.talking = user.talking;
234+
n.userStatus = user.userStatus;
235+
n.voiceJoined = user.voiceJoined;
236+
n.voiceLocked = user.voiceLocked;
237+
n.voiceMuted = user.voiceMuted;
238+
n.voiceUserid = user.voiceUserid;
230239

231240
return n;
232241
}

bigbluebutton-client/src/org/bigbluebutton/main/model/users/Conference.as

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ package org.bigbluebutton.main.model.users {
5353

5454
// Custom sort function for the users ArrayCollection. Need to put dial-in users at the very bottom.
5555
private function sortFunction(a:Object, b:Object, array:Array = null):int {
56-
if (a.presenter)
56+
/*if (a.presenter)
5757
return -1;
5858
else if (b.presenter)
59-
return 1;
60-
else if (a.role == Role.MODERATOR && b.role == Role.MODERATOR) {
59+
return 1;*/
60+
if (a.role == Role.MODERATOR && b.role == Role.MODERATOR) {
6161
// do nothing go to the end and check names
6262
} else if (a.role == Role.MODERATOR)
6363
return -1;

bigbluebutton-client/src/org/bigbluebutton/modules/participants/business/ListenersSOService.as

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,28 @@ package org.bigbluebutton.modules.participants.business
255255
}
256256
}
257257

258+
public function lockMuteUser(userid:Number, lock:Boolean):void {
259+
var nc:NetConnection = _module.connection;
260+
nc.call(
261+
"voice.lockMuteUser",// Remote function name
262+
new Responder(
263+
// participants - On successful result
264+
function(result:Object):void {
265+
LogUtil.debug("Successfully lock mute/unmute: " + userid);
266+
},
267+
// status - On error occurred
268+
function(status:Object):void {
269+
LogUtil.error("Error occurred:");
270+
for (var x:Object in status) {
271+
LogUtil.error(x + " : " + status[x]);
272+
}
273+
}
274+
),//new Responder
275+
userid,
276+
lock
277+
); //_netConnection.call
278+
}
279+
258280
public function muteUnmuteUser(userid:Number, mute:Boolean):void {
259281
var nc:NetConnection = _module.connection;
260282
nc.call(

bigbluebutton-client/src/org/bigbluebutton/modules/participants/business/ParticipantsProxy.as

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package org.bigbluebutton.modules.participants.business
2222

2323
import mx.collections.ArrayCollection;
2424

25+
import org.bigbluebutton.common.Role;
2526
import org.bigbluebutton.core.UsersUtil;
2627
import org.bigbluebutton.core.managers.UserManager;
2728
import org.bigbluebutton.main.model.users.BBBUser;
@@ -88,6 +89,18 @@ package org.bigbluebutton.modules.participants.business
8889
public function unmuteAllUsers(command:VoiceConfEvent):void{
8990
_listenersService.muteAllUsers(false);
9091
}
92+
93+
public function muteAlmostAllUsers(command:VoiceConfEvent):void
94+
{
95+
//find the presenter and lock them
96+
var pres:BBBUser = UserManager.getInstance().getConference().getPresenter();
97+
_listenersService.lockMuteUser(int(pres.voiceUserid), true);
98+
99+
_listenersService.muteAllUsers(true);
100+
101+
//unlock the presenter
102+
_listenersService.lockMuteUser(int(pres.voiceUserid), false);
103+
}
91104

92105
public function kickUser(event:KickUserEvent):void {
93106
var user:BBBUser = UsersUtil.getUser(event.userid);

bigbluebutton-client/src/org/bigbluebutton/modules/participants/events/VoiceConfEvent.as

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ package org.bigbluebutton.modules.participants.events
2525
public static const MUTE_ALL:String = "VOICECONF_MUTE_ALL";
2626
public static const UNMUTE_ALL:String = "VOICECONF_UNMUTE_ALL";
2727

28+
public static const MUTE_ALMOST_ALL:String = "VOICECONF_MUTE_ALMOST_ALL";
29+
2830
public static const MUTE_USER:String = "VOICECONF_MUTE_USER";
2931
public static const UNMUTE_USER:String = "VOICECONF_UNMUTE_USER";
3032

bigbluebutton-client/src/org/bigbluebutton/modules/participants/maps/ParticipantsEventMap.mxml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
7070
<MethodInvoker generator="{ParticipantsProxy}" method="unmuteAllUsers" arguments="{event}" />
7171
</EventHandlers>
7272

73+
<EventHandlers type="{VoiceConfEvent.MUTE_ALMOST_ALL}" >
74+
<MethodInvoker generator="{ParticipantsProxy}" method="muteAlmostAllUsers" arguments="{event}" />
75+
</EventHandlers>
76+
7377
</EventMap>

bigbluebutton-client/src/org/bigbluebutton/modules/participants/views/MediaItemRenderer.mxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
}
105105
]]>
106106
</mx:Script>
107-
107+
<mx:Image id="showLock" visible="{data.voiceLocked}" source="{images.lock_close}" width="20" height="20" />
108108
<mx:Image id="talkingIcon" visible="{data.talking}" source="{images.sound_new}" width="20" height="20"
109109
toolTip="{ResourceUtil.getInstance().getString('bbb.listenerItem.talkImg.toolTip')}" />
110110
<mx:Button id="webcamBtn" visible="{data.hasStream}" click="viewCamera()" icon="{images.webcam_new}"

bigbluebutton-client/src/org/bigbluebutton/modules/participants/views/ParticipantsWindow.mxml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,13 @@
175175
176176
if (amIModerator) {
177177
myMenuData[1] = {type: "separator"};
178-
if (!roomMuted)
179-
myMenuData[2] = {label: "Mute All", icon: images.audio_muted};
180-
else
181-
myMenuData[2] = {label: "Unmute All", icon: images.audio};
182-
myMenuData[3] = {label: "Lower All Hands", icon: images.hand_new};
178+
myMenuData[2] = {label: "Lower All Hands", icon: images.hand_new};
179+
if (!roomMuted) {
180+
myMenuData[3] = {label: "Mute All", icon: images.audio_muted};
181+
myMenuData[4] = {label: "Mute All Except Presenter", icon: images.audio_muted};
182+
} else
183+
myMenuData[3] = {label: "Unmute All", icon: images.audio};
184+
183185
}
184186
185187
// make sure the previous menu is closed before opening a new one
@@ -202,11 +204,13 @@
202204
showAudioSettings();
203205
break;
204206
case 2:
205-
muteAll();
207+
lowerHands();
206208
break;
207209
case 3:
208-
lowerHands();
210+
muteAll();
209211
break;
212+
case 4:
213+
muteAlmostAll();
210214
}
211215
}
212216
@@ -232,6 +236,16 @@
232236
}
233237
}
234238
239+
private function muteAlmostAll():void {
240+
if (amIModerator) {
241+
if (!roomMuted) {
242+
var muteCommand:VoiceConfEvent = new VoiceConfEvent(VoiceConfEvent.MUTE_ALMOST_ALL);
243+
dispatchEvent(muteCommand);
244+
roomMuted = true;
245+
}
246+
}
247+
}
248+
235249
private function lowerHands():void {
236250
for (var i:int = 0; i < participants.length; i++) {
237251
var p:BBBUser = participants.getItemAt(i) as BBBUser;

0 commit comments

Comments
 (0)