Merge pull request #5314 from ritzalam/mobile-lock-settings
Mobile lock settings
This commit is contained in:
commit
880c5dc48e
@ -34,9 +34,9 @@ trait MuteUserCmdMsgHdlr extends RightsManagementTrait {
|
||||
requester <- Users2x.findWithIntId(liveMeeting.users2x, msg.header.userId)
|
||||
u <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId)
|
||||
} yield {
|
||||
if (requester.role != Roles.MODERATOR_ROLE && permissions.disableMic &&
|
||||
if (requester.role != Roles.MODERATOR_ROLE && permissions.disableMic && u.muted &&
|
||||
msg.body.userId == msg.header.userId) {
|
||||
// muting/unmuting self while not moderator and mic disabled. Do not allow.
|
||||
// unmuting self while not moderator and mic disabled. Do not allow.
|
||||
} else {
|
||||
if (u.muted != msg.body.mute) {
|
||||
log.info("Send mute user request. meetingId=" + meetingId + " userId=" + u.intId + " user=" + u)
|
||||
|
@ -179,6 +179,7 @@ package org.bigbluebutton.air.chat.views {
|
||||
chatMessageService.sendMessageOnSuccessSignal.remove(onSendSuccess);
|
||||
chatMessageService.sendMessageOnFailureSignal.remove(onSendFailure);
|
||||
meetingData.users.userChangeSignal.remove(onUserChange);
|
||||
meetingData.meetingStatus.lockSettingsChangeSignal.remove(onLockSettingsChanged);
|
||||
|
||||
if (_chat) {
|
||||
_chat.newMessageSignal.remove(onNewMessage);
|
||||
|
@ -16,7 +16,6 @@ package org.bigbluebutton.air.main.commands {
|
||||
import org.bigbluebutton.air.user.models.User2x;
|
||||
import org.bigbluebutton.air.user.models.UserChangeEnum;
|
||||
import org.bigbluebutton.air.user.services.IUsersService;
|
||||
import org.bigbluebutton.air.video.commands.ShareCameraSignal;
|
||||
import org.bigbluebutton.air.video.services.IVideoConnection;
|
||||
import org.bigbluebutton.air.voice.commands.ShareMicrophoneSignal;
|
||||
import org.bigbluebutton.air.voice.models.PhoneOptions;
|
||||
@ -85,10 +84,7 @@ package org.bigbluebutton.air.main.commands {
|
||||
|
||||
[Inject]
|
||||
public var shareMicrophoneSignal:ShareMicrophoneSignal;
|
||||
|
||||
[Inject]
|
||||
public var shareCameraSignal:ShareCameraSignal;
|
||||
|
||||
|
||||
private var authTokenTimeout:Timer;
|
||||
|
||||
private var joinMeetingTimeout:Timer;
|
||||
|
@ -37,7 +37,6 @@ package org.bigbluebutton.air.main.models {
|
||||
function get videoProfileManager():VideoProfileManager
|
||||
function set videoProfileManager(value:VideoProfileManager):void;
|
||||
function get authTokenSignal():ISignal
|
||||
function get lockSettings():LockSettings;
|
||||
function set meetingMuted(mute:Boolean):void;
|
||||
function get meetingMuted():Boolean;
|
||||
function get pushToTalk():Boolean;
|
||||
|
@ -37,9 +37,7 @@ package org.bigbluebutton.air.main.models {
|
||||
protected var _meetingMuted:Boolean;
|
||||
|
||||
protected var _joinUrl:String;
|
||||
|
||||
protected var _lockSettings:LockSettings;
|
||||
|
||||
|
||||
protected var _pushToTalk:Boolean;
|
||||
|
||||
protected var _assignedDeskshareSignal:ISignal = new Signal();
|
||||
@ -67,11 +65,7 @@ package org.bigbluebutton.air.main.models {
|
||||
public function set videoProfileManager(value:VideoProfileManager):void {
|
||||
_videoProfileManager = value;
|
||||
}
|
||||
|
||||
public function get lockSettings():LockSettings {
|
||||
return _lockSettings;
|
||||
}
|
||||
|
||||
|
||||
public function get meetingMuted():Boolean {
|
||||
return _meetingMuted;
|
||||
}
|
||||
@ -164,7 +158,6 @@ package org.bigbluebutton.air.main.models {
|
||||
|
||||
public function UserSession() {
|
||||
_presentationList = new PresentationList();
|
||||
_lockSettings = new LockSettings();
|
||||
}
|
||||
|
||||
public function get presentationList():PresentationList {
|
||||
|
@ -1,22 +1,22 @@
|
||||
package org.bigbluebutton.air.main.views {
|
||||
|
||||
import flash.events.MouseEvent;
|
||||
|
||||
import spark.components.CalloutPosition;
|
||||
import spark.components.Alert;
|
||||
import spark.components.CalloutPosition;
|
||||
|
||||
import org.bigbluebutton.air.common.PageEnum;
|
||||
import org.bigbluebutton.air.main.models.IConferenceParameters;
|
||||
import org.bigbluebutton.air.main.models.IMedia;
|
||||
import org.bigbluebutton.air.main.models.IMeetingData;
|
||||
import org.bigbluebutton.air.main.models.IUISession;
|
||||
import org.bigbluebutton.air.main.models.LockSettings2x;
|
||||
import org.bigbluebutton.air.user.models.UserRole;
|
||||
import org.bigbluebutton.air.video.commands.ShareCameraSignal;
|
||||
import org.bigbluebutton.air.video.models.WebcamStreamInfo;
|
||||
import org.bigbluebutton.air.voice.commands.MicrophoneMuteSignal;
|
||||
import org.bigbluebutton.air.voice.commands.ShareMicrophoneSignal;
|
||||
import org.bigbluebutton.air.voice.models.AudioTypeEnum;
|
||||
import org.bigbluebutton.air.voice.models.VoiceUser;
|
||||
|
||||
import robotlegs.bender.bundles.mvcs.Mediator;
|
||||
import robotlegs.bender.extensions.mediatorMap.api.IMediatorMap;
|
||||
|
||||
@ -52,7 +52,7 @@ package org.bigbluebutton.air.main.views {
|
||||
public override function initialize():void {
|
||||
meetingData.voiceUsers.userChangeSignal.add(onVoiceUserChanged);
|
||||
meetingData.webcams.webcamChangeSignal.add(onWebcamChange);
|
||||
|
||||
|
||||
media.cameraPermissionSignal.add(onCameraPermission);
|
||||
media.microphonePermissionSignal.add(onMicrophonePermission);
|
||||
|
||||
@ -64,6 +64,16 @@ package org.bigbluebutton.air.main.views {
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
private function lockCamButtonBasedOnSetting():void {
|
||||
if (meetingData.users.me.locked && meetingData.users.me.role != UserRole.MODERATOR) {
|
||||
if (meetingData.meetingStatus.lockSettings.disableCam) {
|
||||
view.camButton.enabled = false;
|
||||
} else {
|
||||
view.camButton.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function changeStatus(e:MouseEvent):void {
|
||||
var emojicallout:EmojiCallout = new EmojiCallout();
|
||||
emojicallout.horizontalPosition = CalloutPosition.MIDDLE;
|
||||
@ -72,7 +82,24 @@ package org.bigbluebutton.air.main.views {
|
||||
}
|
||||
|
||||
protected function micOnOff(e:MouseEvent):void {
|
||||
microphoneMuteSignal.dispatch(meetingData.users.me.intId);
|
||||
muteUnmuteUser();
|
||||
}
|
||||
|
||||
private function muteUnmuteUser():void {
|
||||
if (meetingData.voiceUsers.me != null) {
|
||||
if (meetingData.users.me.locked && meetingData.users.me.role != UserRole.MODERATOR) {
|
||||
var vu:VoiceUser = meetingData.voiceUsers.getUser(meetingData.users.me.intId);
|
||||
if (vu != null) {
|
||||
if (meetingData.meetingStatus.lockSettings.disableMic && vu.muted) {
|
||||
Alert.show("Unmuting denied.");
|
||||
} else {
|
||||
microphoneMuteSignal.dispatch(meetingData.users.me.intId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
microphoneMuteSignal.dispatch(meetingData.users.me.intId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function audioOnOff(e:MouseEvent):void {
|
||||
@ -87,18 +114,30 @@ package org.bigbluebutton.air.main.views {
|
||||
|
||||
private function joinOrLeaveAudio():void {
|
||||
if (meetingData.voiceUsers.me == null) {
|
||||
uiSession.pushPage(PageEnum.AUDIO);
|
||||
if (meetingData.users.me.locked &&
|
||||
meetingData.users.me.role != UserRole.MODERATOR &&
|
||||
meetingData.meetingStatus.lockSettings.disableMic) {
|
||||
shareMicrophoneSignal.dispatch(AudioTypeEnum.LISTEN_ONLY, conferenceParameters.webvoiceconf);
|
||||
} else {
|
||||
uiSession.pushPage(PageEnum.AUDIO);
|
||||
}
|
||||
} else {
|
||||
shareMicrophoneSignal.dispatch(AudioTypeEnum.LEAVE, "");
|
||||
}
|
||||
}
|
||||
|
||||
private function camOnOff(e:MouseEvent):void {
|
||||
if (media.cameraAvailable) {
|
||||
if (!media.cameraPermissionGranted) {
|
||||
media.requestCameraPermission();
|
||||
} else {
|
||||
enableDisableWebcam();
|
||||
if (meetingData.users.me.locked &&
|
||||
meetingData.users.me.role != UserRole.MODERATOR &&
|
||||
meetingData.meetingStatus.lockSettings.disableCam) {
|
||||
Alert.show("Sharing webcam denied.");
|
||||
} else {
|
||||
if (media.cameraAvailable) {
|
||||
if (!media.cameraPermissionGranted) {
|
||||
media.requestCameraPermission();
|
||||
} else {
|
||||
enableDisableWebcam();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -116,7 +155,7 @@ package org.bigbluebutton.air.main.views {
|
||||
view.camButton.label = "Cam on"; // ResourceManager.getInstance().getString('resources', 'menuButtons.camOn');
|
||||
view.camButton.styleName = "icon-video menuButton"
|
||||
}
|
||||
|
||||
|
||||
if (meetingData.voiceUsers.me) {
|
||||
view.micButton.visible = view.micButton.includeInLayout = !meetingData.voiceUsers.me.listenOnly;
|
||||
view.audioButton.styleName = "icon-audio-off menuButtonRed";
|
||||
@ -170,6 +209,7 @@ package org.bigbluebutton.air.main.views {
|
||||
public override function destroy():void {
|
||||
meetingData.voiceUsers.userChangeSignal.remove(onVoiceUserChanged);
|
||||
meetingData.webcams.webcamChangeSignal.remove(onWebcamChange);
|
||||
|
||||
media.cameraPermissionSignal.remove(onCameraPermission);
|
||||
media.microphonePermissionSignal.remove(onMicrophonePermission);
|
||||
view.audioButton.removeEventListener(MouseEvent.CLICK, audioOnOff);
|
||||
|
@ -38,7 +38,7 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
|
||||
//available = false; // for testing to force using Video instead of StageVideo!!!
|
||||
|
||||
trace("************ ScreenshareView: STAGE VIDEO available=" + available);
|
||||
//trace("************ ScreenshareView: STAGE VIDEO available=" + available);
|
||||
stage.removeEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);
|
||||
// Detect if StageVideo is available and decide what to do in toggleStageVideo
|
||||
toggleStageVideo(available);
|
||||
@ -49,7 +49,7 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
if (available) {
|
||||
if (_sv == null) {
|
||||
_usingStageVideo = true;
|
||||
trace("***** Using StageVideo length=" + stage.stageVideos.length);
|
||||
//trace("***** Using StageVideo length=" + stage.stageVideos.length);
|
||||
_screenshareRunningListener(_usingStageVideo, true);
|
||||
|
||||
setupNetstream();
|
||||
@ -63,8 +63,8 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
// to be relative to this container.
|
||||
var point:Point = this.localToGlobal(new Point(viewPort.x, viewPort.y));
|
||||
var newViewPort:Rectangle = new Rectangle(point.x, point.y, viewPort.width, viewPort.height);
|
||||
trace("****toggleStageVideo ViewPort x=" + viewPort.x + ",y=" + viewPort.y
|
||||
+ " newViewPort x=" + newViewPort.x + ",y=" + newViewPort.y);
|
||||
//trace("****toggleStageVideo ViewPort x=" + viewPort.x + ",y=" + viewPort.y
|
||||
// + " newViewPort x=" + newViewPort.x + ",y=" + newViewPort.y);
|
||||
_sv.viewPort = newViewPort;
|
||||
|
||||
// Listen for event if StageVideo can play the stream.
|
||||
@ -111,7 +111,7 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
private function playStream():void {
|
||||
if (!_played) {
|
||||
_played = true;
|
||||
trace("***** Playing stream " + _streamId);
|
||||
//trace("***** Playing stream " + _streamId);
|
||||
_ns.play(_streamId);
|
||||
}
|
||||
}
|
||||
@ -138,7 +138,7 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
|
||||
setupNetstream();
|
||||
|
||||
trace("***** Using classic Video");
|
||||
//trace("***** Using classic Video");
|
||||
var viewPort:Rectangle = positionAndSize(this.width, this.height, _origVidWidth, _origVidHeight);
|
||||
//trace("**** ViewPort x=" + viewPort.x + ",y=" + viewPort.y);
|
||||
|
||||
@ -156,7 +156,7 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
|
||||
private function stageVideoStateChange(event:StageVideoEvent):void {
|
||||
var status:String = event.status;
|
||||
trace("***** stageVideoStateChange " + status + ",codec=" + event.codecInfo + ",color=" + event.colorSpace);
|
||||
//trace("***** stageVideoStateChange " + status + ",codec=" + event.codecInfo + ",color=" + event.colorSpace);
|
||||
var switchToVideo:Boolean = status == flash.media.VideoStatus.UNAVAILABLE;
|
||||
//trace("***** stageVideoStateChange Forcing to use Video " + switchToVideo);
|
||||
//switchToVideo = true; // for testing to force using video
|
||||
@ -168,14 +168,14 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
}
|
||||
|
||||
public function viewStream(conn:NetConnection, streamId:String, width:int, height:int):void {
|
||||
trace("************ ScreenshareView: viewing of screenshare streamId=" + streamId + " w=" + width + " h=" + height);
|
||||
//trace("************ ScreenshareView: viewing of screenshare streamId=" + streamId + " w=" + width + " h=" + height);
|
||||
_conn = conn;
|
||||
_streamId = streamId;
|
||||
_origVidWidth = width;
|
||||
_origVidHeight = height;
|
||||
|
||||
if (stage == null) {
|
||||
trace("************ ScreenshareView: STAGE IS NULL!!!!!!!!");
|
||||
//trace("************ ScreenshareView: STAGE IS NULL!!!!!!!!");
|
||||
} else {
|
||||
stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);
|
||||
}
|
||||
@ -191,7 +191,7 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
|
||||
override protected function updateDisplayList(w:Number, h:Number):void {
|
||||
super.updateDisplayList(w, h);
|
||||
trace("************ ScreenshareView: updateDisplayList !!!!!!!!");
|
||||
//trace("************ ScreenshareView: updateDisplayList !!!!!!!!");
|
||||
updateDisplayStream(w, h);
|
||||
}
|
||||
|
||||
@ -203,26 +203,26 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
// to be relative to this container.
|
||||
var point:Point = this.localToGlobal(new Point(viewPort.x, viewPort.y));
|
||||
var newViewPort:Rectangle = new Rectangle(point.x, point.y, viewPort.width, viewPort.height);
|
||||
trace("**** updateDisplayStream ViewPort x=" + viewPort.x + ",y=" + viewPort.y + " newViewPort x="
|
||||
+ newViewPort.x + ",y=" + newViewPort.y);
|
||||
//trace("**** updateDisplayStream ViewPort x=" + viewPort.x + ",y=" + viewPort.y + " newViewPort x="
|
||||
// + newViewPort.x + ",y=" + newViewPort.y);
|
||||
_sv.viewPort = newViewPort;
|
||||
var tRectCoord:Rectangle = calculateTopBlackRect(this.width, this.height,
|
||||
viewPort.x, viewPort.y, newViewPort.width, newViewPort.height);
|
||||
|
||||
trace("**** updateDisplayStream TopRect x=" + tRectCoord.x + ",y=" + tRectCoord.y + " w="
|
||||
+ tRectCoord.width + ",h=" + tRectCoord.height);
|
||||
//trace("**** updateDisplayStream TopRect x=" + tRectCoord.x + ",y=" + tRectCoord.y + " w="
|
||||
// + tRectCoord.width + ",h=" + tRectCoord.height);
|
||||
|
||||
positionRect(_topRect, tRectCoord);
|
||||
|
||||
var bottRectCoord:Rectangle = calculateBottomBlackRect(this.width, this.height,
|
||||
viewPort.x, viewPort.y, newViewPort.width, newViewPort.height);
|
||||
|
||||
trace("**** updateDisplayStream BottomRect x=" + bottRectCoord.x + ",y=" + bottRectCoord.y + " w="
|
||||
+ bottRectCoord.width + ",h=" + bottRectCoord.height);
|
||||
//trace("**** updateDisplayStream BottomRect x=" + bottRectCoord.x + ",y=" + bottRectCoord.y + " w="
|
||||
// + bottRectCoord.width + ",h=" + bottRectCoord.height);
|
||||
positionRect(_bottomRect, bottRectCoord);
|
||||
|
||||
} else if (_usingVideo) {
|
||||
trace("***** Using classic Video");
|
||||
//trace("***** Using classic Video");
|
||||
//trace("**** ViewPort x=" + viewPort.x + ",y=" + viewPort.y);
|
||||
_ssView.x = viewPort.x;
|
||||
_ssView.y = viewPort.y;
|
||||
@ -258,14 +258,14 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
}
|
||||
|
||||
public function onMetaData(info:Object):void {
|
||||
trace("ScreenshareView::ScreenshareView width={0} height={1}", [info.width, info.height]);
|
||||
//trace("ScreenshareView::ScreenshareView width={0} height={1}", [info.width, info.height]);
|
||||
|
||||
}
|
||||
|
||||
public function dispose():void {
|
||||
trace("************ ScreenshareView: dispose *********************");
|
||||
//trace("************ ScreenshareView: dispose *********************");
|
||||
if (stage != null) {
|
||||
trace("************ ScreenshareView::dispose - remove listener ****************");
|
||||
//trace("************ ScreenshareView::dispose - remove listener ****************");
|
||||
stage.removeEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);
|
||||
}
|
||||
stopViewing();
|
||||
@ -336,13 +336,13 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
|
||||
private function calculateTopBlackRect(contWidth:int, contHeight:int, vidX:int, vidY:int, vidWidth:int, vidHeight:int):Rectangle {
|
||||
if (vidHeight < contHeight) {
|
||||
trace("**** calculateTopBlackRect TopRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
+ ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
//trace("**** calculateTopBlackRect TopRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
// + ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
// Display rectangle at top of video.
|
||||
return new Rectangle(0, 0, contWidth, vidY);
|
||||
} else {
|
||||
trace("**** calculateTopBlackRect LeftRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
+ ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
//trace("**** calculateTopBlackRect LeftRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
// + ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
// Display rectangle on left of video
|
||||
return new Rectangle(0, 0, vidX, contHeight);
|
||||
}
|
||||
@ -350,13 +350,13 @@ package org.bigbluebutton.air.screenshare.views {
|
||||
|
||||
private function calculateBottomBlackRect(contWidth:int, contHeight:int, vidX:int, vidY:int, vidWidth:int, vidHeight:int):Rectangle {
|
||||
if (vidHeight < contHeight) {
|
||||
trace("**** calculateTopBlackRect BottomRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
+ ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
//trace("**** calculateTopBlackRect BottomRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
// + ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
// Display rect at bottom of video
|
||||
return new Rectangle(0, vidY + vidHeight, contWidth, contHeight - (vidY + vidHeight));
|
||||
} else {
|
||||
trace("**** calculateTopBlackRect RightRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
+ ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
//trace("**** calculateTopBlackRect RightRect cw=" + contWidth + ",ch=" + contHeight + " vidx=" + vidX
|
||||
// + ",vidy=" + vidY + " vidw=" + vidWidth + ",vidh=" + vidHeight);
|
||||
// Display rect at right of video
|
||||
return new Rectangle(vidX + vidWidth, 0, contWidth - (vidX + vidWidth), contHeight);
|
||||
}
|
||||
|
@ -22,7 +22,10 @@ package org.bigbluebutton.air.settings.views {
|
||||
view.participantIcon.setInitials(UserUtils.getInitials(meetingData.users.me.name));
|
||||
view.participantIcon.setRole(meetingData.users.me.role);
|
||||
view.participantLabel.text = meetingData.users.me.name;
|
||||
view.settingsList.dataProvider = dataProvider = new ArrayCollection([{label: "Audio", icon: "icon-unmute", page: "audio"}, {label: "Video", icon: "icon-video", page: "camera"}, {label: "Application", icon: "icon-application", page: "chat"}, {label: "Participants", icon: "icon-user", page: "lock"}, {label: "Leave Session", icon: "icon-logout", page: "exit"}]);
|
||||
view.settingsList.dataProvider = dataProvider = new ArrayCollection([{label: "Audio", icon: "icon-unmute", page: "audio"},
|
||||
{label: "Video", icon: "icon-video", page: "camera"},
|
||||
{label: "Application", icon: "icon-application", page: "chat"},
|
||||
{label: "Leave Session", icon: "icon-logout", page: "exit"}]);
|
||||
|
||||
view.settingsList.addEventListener(IndexChangeEvent.CHANGE, onListIndexChangeEvent);
|
||||
}
|
||||
|
@ -1,9 +1,6 @@
|
||||
package org.bigbluebutton.air.settings.views.camera {
|
||||
import mx.core.ClassFactory;
|
||||
import mx.graphics.SolidColor;
|
||||
|
||||
import org.bigbluebutton.air.user.views.UserItemRenderer;
|
||||
|
||||
import spark.components.Button;
|
||||
import spark.components.Group;
|
||||
import spark.components.HGroup;
|
||||
@ -12,7 +9,6 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
import spark.components.ToggleSwitch;
|
||||
import spark.components.VGroup;
|
||||
import spark.components.VideoDisplay;
|
||||
import spark.components.supportClasses.ToggleButtonBase;
|
||||
import spark.layouts.HorizontalAlign;
|
||||
import spark.layouts.VerticalLayout;
|
||||
import spark.primitives.Rect;
|
||||
|
@ -5,6 +5,7 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
import flash.geom.Matrix;
|
||||
import flash.geom.Point;
|
||||
import flash.media.Camera;
|
||||
import flash.media.CameraPosition;
|
||||
import flash.media.Video;
|
||||
|
||||
import org.bigbluebutton.air.common.PageEnum;
|
||||
@ -37,7 +38,7 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
//setSwapCameraButtonEnable(!userMe.hasStream);
|
||||
view.swapCameraButton.addEventListener(MouseEvent.CLICK, mouseClickHandler);
|
||||
}
|
||||
|
||||
|
||||
//setRotateCameraButtonEnable(!userMe.hasStream);
|
||||
// FlexGlobals.topLevelApplication.stage.addEventListener(ResizeEvent.RESIZE, stageOrientationChangingHandler);
|
||||
// view.startCameraButton.addEventListener(MouseEvent.CLICK, onShareCameraClick);
|
||||
@ -86,6 +87,9 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
userSession.videoConnection.selectedCameraRotation = 0;
|
||||
}
|
||||
saveData.save("cameraRotation", userSession.videoConnection.selectedCameraRotation);
|
||||
|
||||
//trace("CAMERA ROTATION = " + userSession.videoConnection.selectedCameraRotation);
|
||||
|
||||
displayPreviewCamera();
|
||||
}
|
||||
|
||||
@ -102,18 +106,31 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
}
|
||||
|
||||
override protected function displayPreviewCamera():void {
|
||||
//trace("DISPLAY PREVIEW CAMERA = " + userSession.videoConnection.selectedCameraRotation);
|
||||
|
||||
var profile:VideoProfile = userSession.videoConnection.selectedCameraQuality;
|
||||
var camera:Camera = getCamera(userSession.videoConnection.cameraPosition);
|
||||
|
||||
if (camera && profile) {
|
||||
var myCam:Video = new Video();
|
||||
|
||||
//trace("Orientation chW=" + view.cameraHolder.width + " chH=" + view.cameraHolder.height
|
||||
// + " profileW=" + profile.width + " profileH=" + profile.height);
|
||||
|
||||
var screenAspectRatio:Number = (view.cameraHolder.width / profile.width) / (view.cameraHolder.height / profile.height);
|
||||
|
||||
if (screenAspectRatio > 1) { //landscape
|
||||
//trace("DISPLAY PREVIEW CAMERA LANDSCAPE screenAspectRatio=" + screenAspectRatio);
|
||||
myCam.height = view.cameraHolder.height;
|
||||
myCam.width = profile.width * view.cameraHolder.height / profile.height;
|
||||
} else { //portrait
|
||||
//trace("DISPLAY PREVIEW CAMERA PORTRAIT screenAspectRatio=" + screenAspectRatio);
|
||||
myCam.width = view.cameraHolder.width;
|
||||
myCam.height = profile.height * view.cameraHolder.width / profile.width;
|
||||
}
|
||||
|
||||
//trace("A0 MyCam x=" + myCam.x + " y=" + myCam.y + " w=" + myCam.width + " h=" + myCam.height);
|
||||
|
||||
if (isCamRotatedSideways()) {
|
||||
camera.setMode(profile.height, profile.width, profile.modeFps);
|
||||
var temp:Number = myCam.width;
|
||||
@ -122,24 +139,41 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
} else {
|
||||
camera.setMode(profile.width, profile.height, profile.modeFps);
|
||||
}
|
||||
rotateObjectAroundInternalPoint(myCam, myCam.x + myCam.width / 2, myCam.y + myCam.height / 2, userSession.videoConnection.selectedCameraRotation);
|
||||
|
||||
//trace("B0 MyCam x=" + myCam.x + " y=" + myCam.y + " w=" + myCam.width + " h=" + myCam.height);
|
||||
|
||||
rotateObjectAroundInternalPoint(myCam, myCam.x + myCam.width / 2, myCam.y + myCam.height / 2,
|
||||
userSession.videoConnection.selectedCameraRotation);
|
||||
|
||||
//trace("C0 MyCam x=" + myCam.x + " y=" + myCam.y + " w=" + myCam.width + " h=" + myCam.height);
|
||||
|
||||
myCam.x = (view.cameraHolder.width - myCam.width) / 2;
|
||||
|
||||
//trace("D0 MyCam x=" + myCam.x + " y=" + myCam.y + " w=" + myCam.width + " h=" + myCam.height);
|
||||
|
||||
if (userSession.videoConnection.selectedCameraRotation == 90) {
|
||||
myCam.y = 0;
|
||||
//myCam.x = (view.cameraHolder.width + myCam.width) / 2;
|
||||
myCam.x = (view.cameraHolder.width + myCam.width) / 2;
|
||||
} else if (userSession.videoConnection.selectedCameraRotation == 270) {
|
||||
myCam.y = myCam.height;
|
||||
} else if (userSession.videoConnection.selectedCameraRotation == 180) {
|
||||
myCam.x = (view.cameraHolder.width + myCam.width) / 2;
|
||||
myCam.y = myCam.height;
|
||||
}
|
||||
|
||||
//trace("E0 MyCam x=" + myCam.x + " y=" + myCam.y + " w=" + myCam.width + " h=" + myCam.height);
|
||||
|
||||
myCam.attachCamera(camera);
|
||||
|
||||
view.previewVideo.removeChildren();
|
||||
|
||||
//trace("MyCam x=" + myCam.x + " y=" + myCam.y + " w=" + myCam.width + " h=" + myCam.height);
|
||||
|
||||
view.previewVideo.addChild(myCam);
|
||||
// view.settingsGroup.y = myCam.height;
|
||||
} else {
|
||||
view.noVideoMessage.visible = true;
|
||||
}
|
||||
|
||||
view.positionActionButtons();
|
||||
}
|
||||
|
||||
@ -169,8 +203,10 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
*/
|
||||
//close old stream on swap
|
||||
private function mouseClickHandler(e:MouseEvent):void {
|
||||
/*
|
||||
if (!userSession.userList.me.hasStream) {
|
||||
var myWebcams:Array = meetingData.webcams.findWebcamsByUserId(meetingData.users.me.intId);
|
||||
var isPublishing:Boolean = myWebcams.length > 0;
|
||||
|
||||
if (!isPublishing) {
|
||||
if (String(userSession.videoConnection.cameraPosition) == CameraPosition.FRONT) {
|
||||
userSession.videoConnection.cameraPosition = CameraPosition.BACK;
|
||||
} else {
|
||||
@ -178,16 +214,15 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
}
|
||||
} else {
|
||||
if (String(userSession.videoConnection.cameraPosition) == CameraPosition.FRONT) {
|
||||
shareCameraSignal.dispatch(!userSession.userList.me.hasStream, CameraPosition.FRONT);
|
||||
shareCameraSignal.dispatch(userSession.userList.me.hasStream, CameraPosition.BACK);
|
||||
shareCameraSignal.dispatch(!isPublishing, CameraPosition.FRONT);
|
||||
shareCameraSignal.dispatch(isPublishing, CameraPosition.BACK);
|
||||
} else {
|
||||
shareCameraSignal.dispatch(!userSession.userList.me.hasStream, CameraPosition.BACK);
|
||||
shareCameraSignal.dispatch(userSession.userList.me.hasStream, CameraPosition.FRONT);
|
||||
shareCameraSignal.dispatch(!isPublishing, CameraPosition.BACK);
|
||||
shareCameraSignal.dispatch(isPublishing, CameraPosition.FRONT);
|
||||
}
|
||||
}
|
||||
saveData.save("cameraPosition", userSession.videoConnection.cameraPosition);
|
||||
displayPreviewCamera();
|
||||
*/
|
||||
}
|
||||
|
||||
override public function destroy():void {
|
||||
|
@ -3,16 +3,17 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.events.ItemClickEvent;
|
||||
|
||||
import spark.events.IndexChangeEvent;
|
||||
|
||||
import org.bigbluebutton.air.common.models.ISaveData;
|
||||
import org.bigbluebutton.air.main.models.IMeetingData;
|
||||
import org.bigbluebutton.air.main.models.IUserSession;
|
||||
import org.bigbluebutton.air.main.models.LockSettings2x;
|
||||
import org.bigbluebutton.air.user.models.User2x;
|
||||
import org.bigbluebutton.air.video.models.VideoProfile;
|
||||
|
||||
import robotlegs.bender.bundles.mvcs.Mediator;
|
||||
|
||||
import spark.events.IndexChangeEvent;
|
||||
|
||||
public class CameraSettingsViewMediatorBase extends Mediator {
|
||||
|
||||
[Inject]
|
||||
@ -48,7 +49,7 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
dataProvider.refresh();
|
||||
view.cameraProfilesList.selectedIndex = dataProvider.getItemIndex(userSession.videoConnection.selectedCameraQuality);
|
||||
|
||||
userSession.lockSettings.disableCamSignal.add(disableCam);
|
||||
meetingData.meetingStatus.lockSettingsChangeSignal.add(onLockSettingsChangeSignal);
|
||||
//setQualityListEnable(!meetingData.users.me.hasStream);
|
||||
}
|
||||
|
||||
@ -69,11 +70,11 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
protected function userChangeHandler(user:User2x, type:int):void {
|
||||
}
|
||||
|
||||
private function disableCam(disable:Boolean):void {
|
||||
if (disable) {
|
||||
// view.startCameraButton.enabled = false;
|
||||
private function onLockSettingsChangeSignal(newSettings:LockSettings2x):void {
|
||||
if (newSettings.disableCam) {
|
||||
//view..enabled = false;
|
||||
} else {
|
||||
// view.startCameraButton.enabled = true;
|
||||
//view.startCameraButton.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,7 +84,7 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
|
||||
override public function destroy():void {
|
||||
super.destroy();
|
||||
userSession.lockSettings.disableCamSignal.remove(disableCam);
|
||||
meetingData.meetingStatus.lockSettingsChangeSignal.remove(onLockSettingsChangeSignal);
|
||||
meetingData.users.userChangeSignal.remove(userChangeHandler);
|
||||
view.cameraProfilesList.removeEventListener(ItemClickEvent.ITEM_CLICK, onCameraQualitySelected);
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ package org.bigbluebutton.air.settings.views.lock {
|
||||
newLockSettings.disablePrivateChat = !view.privateChatCheckbox.selected;
|
||||
newLockSettings.disablePublicChat = !view.publicChatCheckbox.selected;
|
||||
newLockSettings.lockedLayout = !view.layoutCheckbox.selected;
|
||||
newLockSettings.lockOnJoin = userSession.lockSettings.lockOnJoin;
|
||||
newLockSettings.lockOnJoinConfigurable = userSession.lockSettings.lockOnJoinConfigurable;
|
||||
newLockSettings.lockOnJoin = meetingData.meetingStatus.lockSettings.lockOnJoin;
|
||||
newLockSettings.lockOnJoinConfigurable = meetingData.meetingStatus.lockSettings.lockOnJoinConfigurable;
|
||||
saveLockSettingsSignal.dispatch(newLockSettings);
|
||||
userUISession.popPage();
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.bigbluebutton.air.settings.views.lock {
|
||||
import org.bigbluebutton.air.main.models.IUserSession;
|
||||
|
||||
import org.bigbluebutton.air.main.models.IMeetingData;
|
||||
import robotlegs.bender.bundles.mvcs.Mediator;
|
||||
|
||||
public class LockSettingsViewMediatorBase extends Mediator {
|
||||
@ -9,18 +8,18 @@ package org.bigbluebutton.air.settings.views.lock {
|
||||
public var view:LockSettingsViewBase;
|
||||
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
public var meetingData:IMeetingData;
|
||||
|
||||
override public function initialize():void {
|
||||
loadLockSettings();
|
||||
}
|
||||
|
||||
private function loadLockSettings():void {
|
||||
view.webcamCheckbox.selected = !userSession.lockSettings.disableCam;
|
||||
view.microphoneCheckbox.selected = !userSession.lockSettings.disableMic;
|
||||
view.privateChatCheckbox.selected = !userSession.lockSettings.disablePrivateChat;
|
||||
view.publicChatCheckbox.selected = !userSession.lockSettings.disablePublicChat;
|
||||
view.layoutCheckbox.selected = !userSession.lockSettings.lockedLayout;
|
||||
view.webcamCheckbox.selected = !meetingData.meetingStatus.lockSettings.disableCam;
|
||||
view.microphoneCheckbox.selected = !meetingData.meetingStatus.lockSettings.disableMic;
|
||||
view.privateChatCheckbox.selected = !meetingData.meetingStatus.lockSettings.disablePrivChat;
|
||||
view.publicChatCheckbox.selected = !meetingData.meetingStatus.lockSettings.disablePubChat;
|
||||
view.layoutCheckbox.selected = !meetingData.meetingStatus.lockSettings.lockedLayout;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package org.bigbluebutton.air.video {
|
||||
|
||||
import org.bigbluebutton.air.video.commands.ShareCameraCommand;
|
||||
import org.bigbluebutton.air.video.commands.ShareCameraSignal;
|
||||
import org.bigbluebutton.air.video.commands.StopShareCameraCommand;
|
||||
import org.bigbluebutton.air.video.commands.StopShareCameraSignal;
|
||||
import org.bigbluebutton.air.video.views.WebcamDock;
|
||||
import org.bigbluebutton.air.video.views.WebcamDockMediator;
|
||||
|
||||
@ -31,6 +33,7 @@ package org.bigbluebutton.air.video {
|
||||
|
||||
private function signals():void {
|
||||
signalCommandMap.map(ShareCameraSignal).toCommand(ShareCameraCommand);
|
||||
signalCommandMap.map(StopShareCameraSignal).toCommand(StopShareCameraCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,62 @@
|
||||
package org.bigbluebutton.air.video.commands
|
||||
{
|
||||
import flash.media.Camera;
|
||||
|
||||
import org.bigbluebutton.air.main.models.IConferenceParameters;
|
||||
import org.bigbluebutton.air.main.models.IMeetingData;
|
||||
import org.bigbluebutton.air.main.models.IUserSession;
|
||||
import org.bigbluebutton.air.user.services.IUsersService;
|
||||
import org.bigbluebutton.air.video.models.WebcamStreamInfo;
|
||||
|
||||
import robotlegs.bender.bundles.mvcs.Command;
|
||||
|
||||
public class StopShareCameraCommand extends Command
|
||||
{
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
|
||||
[Inject]
|
||||
public var usersService:IUsersService;
|
||||
|
||||
[Inject]
|
||||
public var meetingData:IMeetingData;
|
||||
|
||||
[Inject]
|
||||
public var conferenceParameters:IConferenceParameters;
|
||||
|
||||
override public function execute():void {
|
||||
disableCamera();
|
||||
}
|
||||
|
||||
private function disableCamera():void {
|
||||
var webcams:Array = meetingData.webcams.findWebcamsByUserId(meetingData.users.me.intId);
|
||||
if (webcams.length > 0) {
|
||||
usersService.removeStream(meetingData.users.me.intId, (webcams[0] as WebcamStreamInfo).streamId);
|
||||
userSession.videoConnection.stopPublishing(setupCamera(userSession.videoConnection.cameraPosition));
|
||||
}
|
||||
}
|
||||
|
||||
private function setupCamera(position:String):Camera {
|
||||
return findCamera(position);
|
||||
}
|
||||
|
||||
private function findCamera(position:String):Camera {
|
||||
if (!Camera.isSupported) {
|
||||
return null;
|
||||
}
|
||||
var cam:Camera = this.getCamera(position);
|
||||
return cam;
|
||||
}
|
||||
|
||||
// Get the requested camera. If it cannot be found,
|
||||
// return the device's default camera.
|
||||
private function getCamera(position:String):Camera {
|
||||
for (var i:uint = 0; i < Camera.names.length; ++i) {
|
||||
var cam:Camera = Camera.getCamera(String(i));
|
||||
if (cam.position == position)
|
||||
return cam;
|
||||
}
|
||||
return Camera.getCamera();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package org.bigbluebutton.air.video.commands
|
||||
{
|
||||
import org.osflash.signals.Signal;
|
||||
|
||||
public class StopShareCameraSignal extends Signal
|
||||
{
|
||||
public function StopShareCameraSignal()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
@ -15,9 +15,9 @@ package org.bigbluebutton.air.video.services {
|
||||
import org.bigbluebutton.air.main.models.IMeetingData;
|
||||
import org.bigbluebutton.air.main.models.IUserSession;
|
||||
import org.bigbluebutton.air.main.models.LockSettings2x;
|
||||
import org.bigbluebutton.air.user.models.User2x;
|
||||
import org.bigbluebutton.air.user.models.UserRole;
|
||||
import org.bigbluebutton.air.video.commands.ShareCameraSignal;
|
||||
import org.bigbluebutton.air.video.commands.StopShareCameraSignal;
|
||||
import org.bigbluebutton.air.video.models.VideoProfile;
|
||||
import org.osflash.signals.ISignal;
|
||||
import org.osflash.signals.Signal;
|
||||
@ -43,6 +43,9 @@ package org.bigbluebutton.air.video.services {
|
||||
[Inject]
|
||||
public var shareCameraSignal:ShareCameraSignal;
|
||||
|
||||
[Inject]
|
||||
public var stopShareCameraSignal:StopShareCameraSignal;
|
||||
|
||||
private var cameraToNetStreamMap:Object = new Object();
|
||||
|
||||
private var cameraToStreamNameMap:Object = new Object;
|
||||
@ -70,8 +73,9 @@ package org.bigbluebutton.air.video.services {
|
||||
}
|
||||
|
||||
private function lockSettingsChange(lockSettings:LockSettings2x):void {
|
||||
if (lockSettings.disableCam && meetingData.users.me.locked && meetingData.users.me.role != UserRole.MODERATOR) {
|
||||
shareCameraSignal.dispatch(false, null);
|
||||
if (lockSettings.disableCam && meetingData.users.me.locked &&
|
||||
meetingData.users.me.role != UserRole.MODERATOR) {
|
||||
stopShareCameraSignal.dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,13 +18,12 @@ package org.bigbluebutton.air.voice.commands {
|
||||
public var userId:String;
|
||||
|
||||
override public function execute():void {
|
||||
trace("MicrophoneMuteCommand.execute() - userId = " + userId);
|
||||
var vu:VoiceUser = meetingData.voiceUsers.getUser(userId);
|
||||
if (vu != null) {
|
||||
if (vu.muted) {
|
||||
voiceService.unmute(userId);
|
||||
} else {
|
||||
if (!vu.muted || meetingData.meetingStatus.lockSettings.disableMic) {
|
||||
voiceService.mute(userId);
|
||||
} else {
|
||||
voiceService.unmute(userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ package org.bigbluebutton.air.voice.models {
|
||||
if (index >= 0) {
|
||||
var removedUser:VoiceUser = _users.removeItemAt(index) as VoiceUser;
|
||||
|
||||
if (_me == removedUser) {
|
||||
if (_me.intId == removedUser.intId) {
|
||||
_me = null;
|
||||
}
|
||||
|
||||
@ -77,6 +77,7 @@ package org.bigbluebutton.air.voice.models {
|
||||
// Force user to not talking if muted.
|
||||
user.talking = false;
|
||||
}
|
||||
|
||||
_userChangeSignal.dispatch(user, VoiceUserChangeEnum.MUTE);
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,9 @@ package org.bigbluebutton.air.voice.services {
|
||||
import org.bigbluebutton.air.main.models.IUserSession;
|
||||
import org.bigbluebutton.air.main.models.LockSettings2x;
|
||||
import org.bigbluebutton.air.user.models.UserRole;
|
||||
import org.bigbluebutton.air.voice.commands.MicrophoneMuteSignal;
|
||||
import org.bigbluebutton.air.voice.commands.ShareMicrophoneSignal;
|
||||
import org.bigbluebutton.air.voice.models.VoiceUser;
|
||||
import org.osflash.signals.ISignal;
|
||||
import org.osflash.signals.Signal;
|
||||
|
||||
@ -30,9 +32,9 @@ package org.bigbluebutton.air.voice.services {
|
||||
public var meetingData:IMeetingData;
|
||||
|
||||
[Inject]
|
||||
public var shareMicrophoneSignal:ShareMicrophoneSignal;
|
||||
public var microphoneMuteSignal:MicrophoneMuteSignal;
|
||||
|
||||
public var _callActive:Boolean = false;
|
||||
private var _callActive:Boolean = false;
|
||||
|
||||
protected var _connectionSuccessSignal:ISignal = new Signal();
|
||||
|
||||
@ -61,8 +63,12 @@ package org.bigbluebutton.air.voice.services {
|
||||
|
||||
private function lockSettingsChange(lockSettings:LockSettings2x):void {
|
||||
if (lockSettings.disableMic && meetingData.users.me.locked && meetingData.users.me.role != UserRole.MODERATOR) {
|
||||
trace("TODO: Disabling the mic still needs to be finished");
|
||||
//shareMicrophoneSignal.dispatch(audioOptions);
|
||||
if (meetingData.voiceUsers.me != null) {
|
||||
var vu:VoiceUser = meetingData.voiceUsers.getUser(meetingData.users.me.intId);
|
||||
if (!vu.muted && meetingData.meetingStatus.lockSettings.disableMic) {
|
||||
microphoneMuteSignal.dispatch(meetingData.users.me.intId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,12 +68,11 @@ package org.bigbluebutton.air.voice.services {
|
||||
meetingData.voiceUsers.remove(intId);
|
||||
}
|
||||
|
||||
private function handleUserMutedEvtMsg(msg:Object):void {
|
||||
private function handleUserMutedEvtMsg(msg:Object):void {
|
||||
var header:Object = msg.header as Object;
|
||||
var body:Object = msg.body as Object;
|
||||
var intId:String = body.intId as String;
|
||||
var muted:Boolean = body.muted as Boolean;
|
||||
|
||||
meetingData.voiceUsers.changeUserMute(intId, muted);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user