- mute/unmute all users

- mute all users except presenter
This commit is contained in:
Richard Alam 2014-08-13 12:07:01 -07:00
parent 9b299a9f91
commit b9d6401a9e
12 changed files with 80 additions and 39 deletions

View File

@ -51,13 +51,11 @@ public class VoiceService {
}
*/
public void muteAllUsers(boolean mute, List<Integer> dontMuteThese) {
String conference = getBbbSession().getVoiceBridge();
log.debug("Mute all users in room[" + conference + "], dontLockThese list size = " + dontMuteThese.size());
log.error("TODO: Implement this");
// conferenceService.muteAllBut(conference, mute, dontMuteThese);
public void muteAllUsersExceptPresenter(Map<String, Object> msg) {
String meetingID = Red5.getConnectionLocal().getScope().getName();
String requesterID = getBbbSession().getInternalUserID();
Boolean muteAll = (Boolean) msg.get("mute");
bbbInGW.muteAllExceptPresenter(meetingID, requesterID, muteAll);
}
public void muteAllUsers(Map<String, Object> msg) {

View File

@ -43,6 +43,7 @@ public interface IBigBlueButtonInGW {
void userDisconnectedFromGlobalAudio(String voiceConf, String userid, String name);
// Voice
void muteAllExceptPresenter(String meetingID, String requesterID, Boolean mute);
void muteAllUsers(String meetingID, String requesterID, Boolean mute);
void isMeetingMuted(String meetingID, String requesterID);
void muteUser(String meetingID, String requesterID, String userID, Boolean mute);

View File

@ -399,6 +399,10 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway, presUtil: PreuploadedPresen
*******************************************************************/
val voiceGW = new VoiceInGateway(bbbGW)
def muteAllExceptPresenter(meetingID: String, requesterID: String, mute: java.lang.Boolean) {
voiceGW.muteAllExceptPresenter(meetingID, requesterID, mute)
}
def muteAllUsers(meetingID: String, requesterID: String, mute: java.lang.Boolean) {
voiceGW.muteAllUsers(meetingID, requesterID, mute)
}

View File

@ -62,6 +62,7 @@ class MeetingActor(val meetingID: String, meetingName: String, val recorded: Boo
case msg: UserShareWebcam => handleUserShareWebcam(msg)
case msg: UserUnshareWebcam => handleUserunshareWebcam(msg)
case msg: MuteMeetingRequest => handleMuteMeetingRequest(msg)
case msg: MuteAllExceptPresenterRequest => handleMuteAllExceptPresenterRequest(msg)
case msg: IsMeetingMutedRequest => handleIsMeetingMutedRequest(msg)
case msg: MuteUserRequest => handleMuteUserRequest(msg)
case msg: EjectUserRequest => handleEjectUserRequest(msg)

View File

@ -385,6 +385,11 @@ case class SendVoiceUsersRequest(
meetingID: String,
requesterID: String) extends InMessage
case class MuteAllExceptPresenterRequest(
meetingID: String,
requesterID: String,
mute: Boolean) extends InMessage
case class MuteMeetingRequest(
meetingID: String,
requesterID: String,

View File

@ -51,12 +51,17 @@ trait UsersApp {
}
}
def handleMuteAllExceptPresenterRequest(msg: MuteAllExceptPresenterRequest) {
usersWhoAreNotPresenter foreach {u =>
outGW.send(new MuteVoiceUser(meetingID, recorded, msg.requesterID, u.userID, msg.mute))
}
}
def handleMuteMeetingRequest(msg: MuteMeetingRequest) {
meetingMuted = msg.mute
// users2.unlockedUsers map ({ u =>
// outGW.send(new MuteVoiceUser(meetingID, recorded, msg.requesterID, u.voice.id, msg.mute))
// })
users.getUsers foreach {u =>
outGW.send(new MuteVoiceUser(meetingID, recorded, msg.requesterID, u.userID, msg.mute))
}
}
def handleValidateAuthToken(msg: ValidateAuthToken) {
@ -128,6 +133,17 @@ trait UsersApp {
}
}
def usersWhoAreNotPresenter():Array[UserVO] = {
val au = ArrayBuffer[UserVO]()
users.getUsers foreach {u =>
if (! u.presenter) {
au += u
}
}
au.toArray
}
def affectedUsers(settings: Permissions):Array[UserVO] = {
val au = ArrayBuffer[UserVO]()

View File

@ -8,6 +8,10 @@ trait VoiceApp {
val outGW: MessageOutGateway
def handleMuteAllExceptPresenterRequest(msg: MuteAllExceptPresenterRequest) {
}
def handleMuteMeetingRequest(msg: MuteMeetingRequest) {
}

View File

@ -4,6 +4,11 @@ import org.bigbluebutton.core.BigBlueButtonGateway
import org.bigbluebutton.core.api._
class VoiceInGateway(bbbGW: BigBlueButtonGateway) {
def muteAllExceptPresenter(meetingID: String, requesterID: String, mute: Boolean) {
bbbGW.accept(new MuteAllExceptPresenterRequest(meetingID, requesterID, mute))
}
def muteAllUsers(meetingID: String, requesterID: String, mute: Boolean) {
bbbGW.accept(new MuteMeetingRequest(meetingID, requesterID, mute))
}

View File

@ -240,13 +240,8 @@ package org.bigbluebutton.main.model.users
sender.muteAllUsers(false);
}
public function muteAlmostAllUsers(command:VoiceConfEvent):void {
var dontMuteThese:Array = [];
var pres:BBBUser = UserManager.getInstance().getConference().getPresenter();
if (pres != null) dontMuteThese.push(pres.userID);
sender.muteAllUsers(true, dontMuteThese);
public function muteAllUsersExceptPresenter(command:VoiceConfEvent):void {
sender.muteAllUsersExceptPresenter(true);
}
public function ejectUser(command:VoiceConfEvent):void {

View File

@ -58,13 +58,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import flash.events.MouseEvent;
import flash.geom.Point;
import flexlib.mdi.containers.MDIWindow;
import flexlib.mdi.effects.effectsLib.MDIVistaEffects;
import mx.collections.ArrayCollection;
import mx.containers.TitleWindow;
import mx.controls.Alert;
@ -74,7 +71,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.events.CloseEvent;
import mx.events.FlexEvent;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.IBbbModuleWindow;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;

View File

@ -110,7 +110,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
</EventHandlers>
<EventHandlers type="{VoiceConfEvent.MUTE_ALMOST_ALL}" >
<MethodInvoker generator="{UserService}" method="muteAlmostAllUsers" arguments="{event}" />
<MethodInvoker generator="{UserService}" method="muteAllUsersExceptPresenter" arguments="{event}" />
</EventHandlers>
<!-- Lock Events -->

View File

@ -139,7 +139,7 @@ package org.bigbluebutton.modules.users.services
}
public function changeRecordingStatus(userID:String, recording:Boolean):void {
trace("Sending setRecordingStatus. recording=[" + recording + "]");
trace(LOG + "Sending setRecordingStatus. recording=[" + recording + "]");
var message:Object = new Object();
message["userId"] = userID;
message["recording"] = recording;
@ -157,17 +157,33 @@ package org.bigbluebutton.modules.users.services
); //_netConnection.call
}
public function muteAllUsers(mute:Boolean, dontMuteThese:Array = null):void {
if (dontMuteThese == null) dontMuteThese = [];
trace("Sending muteAllUsers. ");
public function muteAllUsers(mute:Boolean):void {
trace(LOG + "Sending muteAllUsersExceptPresenter. mute=[" + mute + "]");
var message:Object = new Object();
message["mute"] = mute;
message["exceptUsers"] = dontMuteThese;
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage(
"voice.muteUnmuteUser",
"voice.muteAllUsers",
function(result:String):void { // On successful result
LogUtil.debug(result);
},
function(status:String):void { // status - On error occurred
LogUtil.error(status);
},
message
);
}
public function muteAllUsersExceptPresenter(mute:Boolean):void {
trace(LOG + "Sending muteAllUsersExceptPresenter. mute=[" + mute + "]");
var message:Object = new Object();
message["mute"] = mute;
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage(
"voice.muteAllUsersExceptPresenter",
function(result:String):void { // On successful result
LogUtil.debug(result);
},
@ -179,7 +195,7 @@ package org.bigbluebutton.modules.users.services
}
public function muteUnmuteUser(userid:String, mute:Boolean):void {
trace("Sending muteUnmuteUser. id=[" + userid + "]");
trace(LOG + "Sending muteUnmuteUser. id=[" + userid + "], mute=[" + mute + "]");
var message:Object = new Object();
message["userId"] = userid;
message["mute"] = mute;