Move shared mediator listeners and actions from AIR mediators to base mediators.
This commit is contained in:
parent
ee5becda1c
commit
08e4dcd25f
@ -23,6 +23,7 @@ package org.bigbluebutton.air.main.commands {
|
||||
uiSession.popPage();
|
||||
|
||||
uiSession.setLoading(false, "Loading Finished");
|
||||
// fixme: this view is already loaded in onLoadingChange of LoadScreenMadiator class
|
||||
uiSession.pushPage(PageEnum.MAIN);
|
||||
// displayAudioSettings();
|
||||
// if (userSession.videoAutoStart && !userSession.skipCamSettingsCheck) {
|
||||
|
@ -4,41 +4,23 @@ package org.bigbluebutton.air.settings.views.audio {
|
||||
import flash.utils.Timer;
|
||||
|
||||
import org.bigbluebutton.air.main.models.IUISession;
|
||||
import org.bigbluebutton.lib.common.models.ISaveData;
|
||||
import org.bigbluebutton.lib.main.models.IUserSession;
|
||||
import org.bigbluebutton.lib.settings.views.audio.AudioSettingsViewMediatorBase;
|
||||
import org.bigbluebutton.lib.user.models.User;
|
||||
import org.bigbluebutton.lib.user.models.UserList;
|
||||
import org.bigbluebutton.lib.voice.commands.ShareMicrophoneSignal;
|
||||
|
||||
public class AudioSettingsViewMediatorAIR extends AudioSettingsViewMediatorBase {
|
||||
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
|
||||
[Inject]
|
||||
public var userUISession:IUISession;
|
||||
|
||||
[Inject]
|
||||
public var saveData:ISaveData;
|
||||
|
||||
[Inject]
|
||||
public var shareMicrophoneSignal:ShareMicrophoneSignal;
|
||||
|
||||
private var micActivityTimer:Timer = null;
|
||||
|
||||
override public function initialize():void {
|
||||
userSession.userList.userChangeSignal.add(userChangeHandler);
|
||||
super.initialize();
|
||||
var userMe:User = userSession.userList.me;
|
||||
|
||||
// view.continueBtn.addEventListener(MouseEvent.CLICK, onContinueClick);
|
||||
view.audioToggle.addEventListener(Event.CHANGE, onEnableAudioClick);
|
||||
view.microphoneToggle.addEventListener(Event.CHANGE, onMicrophoneToggleClick);
|
||||
// view.enablePushToTalk.addEventListener(Event.CHANGE, onEnablePushToTalkClick);
|
||||
view.gainSlider.addEventListener(Event.CHANGE, gainChange);
|
||||
userSession.lockSettings.disableMicSignal.add(disableMic);
|
||||
disableMic(userSession.lockSettings.disableMic && userMe.role != User.MODERATOR && !userMe.presenter && userMe.locked);
|
||||
view.audioToggle.selected = (userMe.voiceJoined || userMe.listenOnly);
|
||||
// view.enablePushToTalk.enabled = view.microphoneToggle.selected = userMe.voiceJoined;
|
||||
// view.enablePushToTalk.selected = (userSession.pushToTalk || userSession.phoneOptions.autoJoin);
|
||||
loadMicGain();
|
||||
@ -55,24 +37,6 @@ package org.bigbluebutton.air.settings.views.audio {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function setMicGain(gain:Number):void {
|
||||
if (userSession.voiceStreamManager) {
|
||||
userSession.voiceStreamManager.setDefaultMicGain(gain);
|
||||
if (!userSession.pushToTalk && userSession.voiceStreamManager.mic) {
|
||||
userSession.voiceStreamManager.mic.gain = gain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function gainChange(e:Event):void {
|
||||
var gain:Number = e.target.value * 10
|
||||
saveData.save("micGain", gain);
|
||||
setMicGain(gain);
|
||||
}
|
||||
|
||||
|
||||
private function micActivity(e:TimerEvent):void {
|
||||
// if (userSession.voiceStreamManager && userSession.voiceStreamManager.mic) {
|
||||
// view.micActivityMask.width = view.gainSlider.width - (view.gainSlider.width * userSession.voiceStreamManager.mic.activityLevel / 100);
|
||||
@ -80,72 +44,23 @@ package org.bigbluebutton.air.settings.views.audio {
|
||||
// }
|
||||
}
|
||||
|
||||
private function disableMic(disable:Boolean):void {
|
||||
if (disable) {
|
||||
view.microphoneToggle.enabled = false;
|
||||
view.microphoneToggle.selected = false;
|
||||
} else {
|
||||
view.microphoneToggle.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function onContinueClick(event:Event):void {
|
||||
userUISession.popPage();
|
||||
}
|
||||
|
||||
|
||||
private function onEnableAudioClick(event:Event):void {
|
||||
if (!view.audioToggle.selected) {
|
||||
view.microphoneToggle.selected = false;
|
||||
// view.enablePushToTalk.enabled = false;
|
||||
userSession.pushToTalk = false;
|
||||
}
|
||||
var audioOptions:Object = new Object();
|
||||
audioOptions.shareMic = userSession.userList.me.voiceJoined = view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
audioOptions.listenOnly = userSession.userList.me.listenOnly = !view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
shareMicrophoneSignal.dispatch(audioOptions);
|
||||
}
|
||||
|
||||
|
||||
private function onMicrophoneToggleClick(event:Event):void {
|
||||
// view.enablePushToTalk.enabled = view.microphoneToggle.selected;
|
||||
if (view.microphoneToggle.selected) {
|
||||
view.audioToggle.selected = true;
|
||||
}
|
||||
// userSession.pushToTalk = (view.enablePushToTalk.selected && view.enablePushToTalk.enabled);
|
||||
var audioOptions:Object = new Object();
|
||||
audioOptions.shareMic = userSession.userList.me.voiceJoined = view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
audioOptions.listenOnly = userSession.userList.me.listenOnly = !view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
shareMicrophoneSignal.dispatch(audioOptions);
|
||||
}
|
||||
|
||||
// private function onEnablePushToTalkClick(event:Event):void {
|
||||
// userSession.pushToTalk = view.enablePushToTalk.selected;
|
||||
// }
|
||||
|
||||
private function userChangeHandler(user:User, type:int):void {
|
||||
if (user.me) {
|
||||
if (type == UserList.LISTEN_ONLY) {
|
||||
view.audioToggle.selected = user.voiceJoined || user.listenOnly;
|
||||
view.microphoneToggle.selected = user.voiceJoined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function destroy():void {
|
||||
super.destroy();
|
||||
|
||||
userSession.lockSettings.disableMicSignal.remove(disableMic);
|
||||
// view.continueBtn.removeEventListener(MouseEvent.CLICK, onContinueClick);
|
||||
view.audioToggle.removeEventListener(Event.CHANGE, onEnableAudioClick);
|
||||
view.microphoneToggle.removeEventListener(Event.CHANGE, onMicrophoneToggleClick);
|
||||
if (micActivityTimer) {
|
||||
micActivityTimer.removeEventListener(TimerEvent.TIMER, micActivity);
|
||||
}
|
||||
// view.enablePushToTalk.removeEventListener(Event.CHANGE, onEnablePushToTalkClick);
|
||||
view.gainSlider.removeEventListener(Event.CHANGE, gainChange);
|
||||
userSession.userList.userChangeSignal.remove(userChangeHandler);
|
||||
userSession.phoneOptions.autoJoin = false;
|
||||
}
|
||||
|
||||
|
@ -8,46 +8,24 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
import flash.media.CameraPosition;
|
||||
import flash.media.Video;
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.events.ItemClickEvent;
|
||||
|
||||
import spark.events.IndexChangeEvent;
|
||||
|
||||
import org.bigbluebutton.air.common.PageEnum;
|
||||
import org.bigbluebutton.air.main.models.IUISession;
|
||||
import org.bigbluebutton.lib.common.models.ISaveData;
|
||||
import org.bigbluebutton.lib.main.models.IUserSession;
|
||||
import org.bigbluebutton.lib.settings.views.camera.CameraSettingsViewMediatorBase;
|
||||
import org.bigbluebutton.lib.user.models.User;
|
||||
import org.bigbluebutton.lib.user.models.UserList;
|
||||
import org.bigbluebutton.lib.video.commands.CameraQualitySignal;
|
||||
import org.bigbluebutton.lib.video.commands.ShareCameraSignal;
|
||||
import org.bigbluebutton.lib.video.models.VideoProfile;
|
||||
|
||||
public class CameraSettingsViewMediatorAIR extends CameraSettingsViewMediatorBase {
|
||||
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
|
||||
[Inject]
|
||||
public var userUISession:IUISession;
|
||||
|
||||
[Inject]
|
||||
public var shareCameraSignal:ShareCameraSignal;
|
||||
|
||||
[Inject]
|
||||
public var changeQualitySignal:CameraQualitySignal;
|
||||
|
||||
[Inject]
|
||||
public var saveData:ISaveData;
|
||||
|
||||
protected var dataProvider:ArrayCollection;
|
||||
|
||||
override public function initialize():void {
|
||||
dataProvider = new ArrayCollection();
|
||||
view.cameraProfilesList.dataProvider = dataProvider;
|
||||
displayCameraProfiles();
|
||||
userSession.userList.userChangeSignal.add(userChangeHandler);
|
||||
super.initialize();
|
||||
var userMe:User = userSession.userList.me;
|
||||
if (Camera.getCamera() == null) {
|
||||
// view.startCameraButton.label = ResourceManager.getInstance().getString('resources', 'profile.settings.camera.unavailable');
|
||||
@ -62,13 +40,11 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
setSwapCameraButtonEnable(!userMe.hasStream);
|
||||
view.swapCameraButton.addEventListener(MouseEvent.CLICK, mouseClickHandler);
|
||||
}
|
||||
userSession.lockSettings.disableCamSignal.add(disableCam);
|
||||
setQualityListEnable(!userSession.userList.me.hasStream);
|
||||
|
||||
setRotateCameraButtonEnable(!userMe.hasStream);
|
||||
// FlexGlobals.topLevelApplication.stage.addEventListener(ResizeEvent.RESIZE, stageOrientationChangingHandler);
|
||||
// view.startCameraButton.addEventListener(MouseEvent.CLICK, onShareCameraClick);
|
||||
view.rotateCameraButton.addEventListener(MouseEvent.CLICK, onRotateCameraClick);
|
||||
view.cameraProfilesList.addEventListener(IndexChangeEvent.CHANGE, onCameraQualitySelected);
|
||||
// FlexGlobals.topLevelApplication.topActionBar.pageName.text = ResourceManager.getInstance().getString('resources', 'cameraSettings.title');
|
||||
displayPreviewCamera();
|
||||
}
|
||||
@ -78,24 +54,8 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
userUISession.pushPage(PageEnum.CAMERASETTINGS);
|
||||
}
|
||||
|
||||
private function disableCam(disable:Boolean):void {
|
||||
if (disable) {
|
||||
// view.startCameraButton.enabled = false;
|
||||
} else {
|
||||
// view.startCameraButton.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function displayCameraProfiles():void {
|
||||
var videoProfiles:Array = userSession.videoProfileManager.profiles;
|
||||
for each (var profile:VideoProfile in videoProfiles) {
|
||||
dataProvider.addItem(profile);
|
||||
}
|
||||
dataProvider.refresh();
|
||||
view.cameraProfilesList.selectedIndex = dataProvider.getItemIndex(userSession.videoConnection.selectedCameraQuality);
|
||||
}
|
||||
|
||||
private function userChangeHandler(user:User, type:int):void {
|
||||
override protected function userChangeHandler(user:User, type:int):void {
|
||||
if (user.me) {
|
||||
if (type == UserList.HAS_STREAM) {
|
||||
// view.startCameraButton.label = ResourceManager.getInstance().getString('resources', user.hasStream ? 'profile.settings.camera.on' : 'profile.settings.camera.off');
|
||||
@ -136,28 +96,11 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
view.rotateCameraButton.enabled = enabled;
|
||||
}
|
||||
|
||||
protected function setQualityListEnable(enabled:Boolean):void {
|
||||
view.cameraProfilesList.enabled = enabled;
|
||||
}
|
||||
|
||||
protected function onCameraQualitySelected(event:IndexChangeEvent):void {
|
||||
if (event.newIndex >= 0) {
|
||||
var profile:VideoProfile = dataProvider.getItemAt(event.newIndex) as VideoProfile;
|
||||
if (userSession.userList.me.hasStream) {
|
||||
changeQualitySignal.dispatch(profile);
|
||||
} else {
|
||||
userSession.videoConnection.selectedCameraQuality = profile;
|
||||
}
|
||||
saveData.save("cameraQuality", userSession.videoConnection.selectedCameraQuality.id);
|
||||
displayPreviewCamera();
|
||||
}
|
||||
}
|
||||
|
||||
private function isCamRotatedSideways():Boolean {
|
||||
return (userSession.videoConnection.selectedCameraRotation == 90 || userSession.videoConnection.selectedCameraRotation == 270);
|
||||
}
|
||||
|
||||
private function displayPreviewCamera():void {
|
||||
override protected function displayPreviewCamera():void {
|
||||
var profile:VideoProfile = userSession.videoConnection.selectedCameraQuality
|
||||
var camera:Camera = getCamera(userSession.videoConnection.cameraPosition);
|
||||
if (camera) {
|
||||
@ -182,7 +125,7 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
myCam.x = (view.cameraHolder.width - myCam.width) / 2;
|
||||
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) {
|
||||
@ -246,12 +189,9 @@ package org.bigbluebutton.air.settings.views.camera {
|
||||
|
||||
override public function destroy():void {
|
||||
super.destroy();
|
||||
userSession.lockSettings.disableCamSignal.remove(disableCam);
|
||||
userSession.userList.userChangeSignal.remove(userChangeHandler);
|
||||
if (Camera.names.length > 1) {
|
||||
view.swapCameraButton.removeEventListener(MouseEvent.CLICK, mouseClickHandler);
|
||||
}
|
||||
view.cameraProfilesList.removeEventListener(ItemClickEvent.ITEM_CLICK, onCameraQualitySelected);
|
||||
// FlexGlobals.topLevelApplication.stage.removeEventListener(ResizeEvent.RESIZE, stageOrientationChangingHandler);
|
||||
// view.startCameraButton.removeEventListener(MouseEvent.CLICK, onShareCameraClick);
|
||||
view.rotateCameraButton.removeEventListener(MouseEvent.CLICK, onRotateCameraClick);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package org.bigbluebutton.air.settings.views.chat {
|
||||
import org.bigbluebutton.lib.chat.views.ChatViewMediatorBase;
|
||||
import org.bigbluebutton.lib.settings.views.chat.ChatSettingsViewMediatorBase;
|
||||
|
||||
public class ChatSettingsViewMediatorAIR extends ChatViewMediatorBase {
|
||||
public class ChatSettingsViewMediatorAIR extends ChatSettingsViewMediatorBase {
|
||||
}
|
||||
}
|
||||
|
@ -4,14 +4,10 @@ package org.bigbluebutton.air.settings.views.lock {
|
||||
|
||||
import org.bigbluebutton.air.main.models.IUISession;
|
||||
import org.bigbluebutton.lib.main.commands.SaveLockSettingsSignal;
|
||||
import org.bigbluebutton.lib.main.models.IUserSession;
|
||||
import org.bigbluebutton.lib.settings.views.lock.LockSettingsViewMediatorBase;
|
||||
|
||||
public class LockSettingsViewMediatorAIR extends LockSettingsViewMediatorBase {
|
||||
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
|
||||
[Inject]
|
||||
public var saveLockSettingsSignal:SaveLockSettingsSignal;
|
||||
|
||||
@ -19,7 +15,7 @@ package org.bigbluebutton.air.settings.views.lock {
|
||||
public var userUISession:IUISession;
|
||||
|
||||
override public function initialize():void {
|
||||
loadLockSettings();
|
||||
super.initialize();
|
||||
// view.applyButton.addEventListener(MouseEvent.CLICK, onApply);
|
||||
// FlexGlobals.topLevelApplication.topActionBar.pageName.text = ResourceManager.getInstance().getString('resources', 'lockSettings.title');
|
||||
// FlexGlobals.topLevelApplication.topActionBar.backBtn.visible = true;
|
||||
@ -39,14 +35,6 @@ package org.bigbluebutton.air.settings.views.lock {
|
||||
userUISession.popPage();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
override public function destroy():void {
|
||||
super.destroy();
|
||||
// view.applyButton.removeEventListener(MouseEvent.CLICK, onApply);
|
||||
|
@ -1,10 +1,110 @@
|
||||
package org.bigbluebutton.lib.settings.views.audio {
|
||||
|
||||
import flash.events.Event;
|
||||
|
||||
import org.bigbluebutton.lib.common.models.ISaveData;
|
||||
import org.bigbluebutton.lib.main.models.IUserSession;
|
||||
import org.bigbluebutton.lib.user.models.User;
|
||||
import org.bigbluebutton.lib.user.models.UserList;
|
||||
import org.bigbluebutton.lib.voice.commands.ShareMicrophoneSignal;
|
||||
|
||||
import robotlegs.bender.bundles.mvcs.Mediator;
|
||||
|
||||
public class AudioSettingsViewMediatorBase extends Mediator {
|
||||
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
|
||||
[Inject]
|
||||
public var saveData:ISaveData;
|
||||
|
||||
[Inject]
|
||||
public var shareMicrophoneSignal:ShareMicrophoneSignal;
|
||||
|
||||
[Inject]
|
||||
public var view:AudioSettingsViewBase;
|
||||
|
||||
override public function initialize():void {
|
||||
super.initialize();
|
||||
|
||||
var userMe:User = userSession.userList.me;
|
||||
userSession.userList.userChangeSignal.add(userChangeHandler);
|
||||
userSession.lockSettings.disableMicSignal.add(disableMic);
|
||||
|
||||
view.audioToggle.addEventListener(Event.CHANGE, onEnableAudioClick);
|
||||
view.microphoneToggle.addEventListener(Event.CHANGE, onMicrophoneToggleClick);
|
||||
view.gainSlider.addEventListener(Event.CHANGE, gainChange);
|
||||
|
||||
view.audioToggle.selected = (userMe.voiceJoined || userMe.listenOnly);
|
||||
}
|
||||
|
||||
private function userChangeHandler(user:User, type:int):void {
|
||||
if (user.me) {
|
||||
if (type == UserList.LISTEN_ONLY) {
|
||||
view.audioToggle.selected = user.voiceJoined || user.listenOnly;
|
||||
view.microphoneToggle.selected = user.voiceJoined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function disableMic(disable:Boolean):void {
|
||||
if (disable) {
|
||||
view.microphoneToggle.enabled = false;
|
||||
view.microphoneToggle.selected = false;
|
||||
} else {
|
||||
view.microphoneToggle.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function onEnableAudioClick(event:Event):void {
|
||||
if (!view.audioToggle.selected) {
|
||||
view.microphoneToggle.selected = false;
|
||||
// view.enablePushToTalk.enabled = false;
|
||||
userSession.pushToTalk = false;
|
||||
}
|
||||
var audioOptions:Object = new Object();
|
||||
audioOptions.shareMic = userSession.userList.me.voiceJoined = view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
audioOptions.listenOnly = userSession.userList.me.listenOnly = !view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
shareMicrophoneSignal.dispatch(audioOptions);
|
||||
}
|
||||
|
||||
|
||||
private function onMicrophoneToggleClick(event:Event):void {
|
||||
// view.enablePushToTalk.enabled = view.microphoneToggle.selected;
|
||||
if (view.microphoneToggle.selected) {
|
||||
view.audioToggle.selected = true;
|
||||
}
|
||||
// userSession.pushToTalk = (view.enablePushToTalk.selected && view.enablePushToTalk.enabled);
|
||||
var audioOptions:Object = new Object();
|
||||
audioOptions.shareMic = userSession.userList.me.voiceJoined = view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
audioOptions.listenOnly = userSession.userList.me.listenOnly = !view.microphoneToggle.selected && view.audioToggle.selected;
|
||||
shareMicrophoneSignal.dispatch(audioOptions);
|
||||
}
|
||||
|
||||
private function gainChange(e:Event):void {
|
||||
var gain:Number = e.target.value * 10
|
||||
saveData.save("micGain", gain);
|
||||
setMicGain(gain);
|
||||
}
|
||||
|
||||
private function setMicGain(gain:Number):void {
|
||||
if (userSession.voiceStreamManager) {
|
||||
userSession.voiceStreamManager.setDefaultMicGain(gain);
|
||||
if (!userSession.pushToTalk && userSession.voiceStreamManager.mic) {
|
||||
userSession.voiceStreamManager.mic.gain = gain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function destroy():void {
|
||||
super.destroy();
|
||||
|
||||
view.audioToggle.removeEventListener(Event.CHANGE, onEnableAudioClick);
|
||||
view.microphoneToggle.removeEventListener(Event.CHANGE, onMicrophoneToggleClick);
|
||||
view.gainSlider.removeEventListener(Event.CHANGE, gainChange);
|
||||
|
||||
userSession.lockSettings.disableMicSignal.remove(disableMic);
|
||||
userSession.userList.userChangeSignal.remove(userChangeHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ package org.bigbluebutton.lib.settings.views.camera {
|
||||
|
||||
_cameraProfilesList = new List();
|
||||
_cameraProfilesList.percentWidth = 100;
|
||||
cameraProfilesList.labelField = "name";
|
||||
var listLayout:VerticalLayout = new VerticalLayout();
|
||||
listLayout.requestedRowCount = -1;
|
||||
listLayout.gap = 0;
|
||||
@ -122,7 +123,7 @@ package org.bigbluebutton.lib.settings.views.camera {
|
||||
positionActionButtons();
|
||||
}
|
||||
|
||||
public function positionActionButtons() : void {
|
||||
public function positionActionButtons():void {
|
||||
_actionsGroup.paddingBottom = getStyle("groupsPadding");
|
||||
_actionsGroup.y = _previewVideo.y + _previewVideo.height + getStyle("groupsPadding");
|
||||
}
|
||||
|
@ -1,10 +1,94 @@
|
||||
package org.bigbluebutton.lib.settings.views.camera {
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.events.ItemClickEvent;
|
||||
|
||||
import spark.events.IndexChangeEvent;
|
||||
|
||||
import org.bigbluebutton.lib.common.models.ISaveData;
|
||||
import org.bigbluebutton.lib.main.models.IUserSession;
|
||||
import org.bigbluebutton.lib.user.models.User;
|
||||
import org.bigbluebutton.lib.video.commands.CameraQualitySignal;
|
||||
import org.bigbluebutton.lib.video.models.VideoProfile;
|
||||
|
||||
import robotlegs.bender.bundles.mvcs.Mediator;
|
||||
|
||||
public class CameraSettingsViewMediatorBase extends Mediator {
|
||||
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
|
||||
[Inject]
|
||||
public var view:CameraSettingsViewBase;
|
||||
|
||||
[Inject]
|
||||
public var changeQualitySignal:CameraQualitySignal;
|
||||
|
||||
[Inject]
|
||||
public var saveData:ISaveData;
|
||||
|
||||
protected var dataProvider:ArrayCollection;
|
||||
|
||||
override public function initialize():void {
|
||||
super.initialize();
|
||||
dataProvider = new ArrayCollection();
|
||||
view.cameraProfilesList.dataProvider = dataProvider;
|
||||
displayCameraProfiles();
|
||||
|
||||
userSession.userList.userChangeSignal.add(userChangeHandler);
|
||||
|
||||
view.cameraProfilesList.addEventListener(IndexChangeEvent.CHANGE, onCameraQualitySelected);
|
||||
}
|
||||
|
||||
private function displayCameraProfiles():void {
|
||||
var videoProfiles:Array = userSession.videoProfileManager.profiles;
|
||||
for each (var profile:VideoProfile in videoProfiles) {
|
||||
dataProvider.addItem(profile);
|
||||
}
|
||||
dataProvider.refresh();
|
||||
view.cameraProfilesList.selectedIndex = dataProvider.getItemIndex(userSession.videoConnection.selectedCameraQuality);
|
||||
|
||||
userSession.lockSettings.disableCamSignal.add(disableCam);
|
||||
setQualityListEnable(!userSession.userList.me.hasStream);
|
||||
}
|
||||
|
||||
protected function onCameraQualitySelected(event:IndexChangeEvent):void {
|
||||
if (event.newIndex >= 0) {
|
||||
var profile:VideoProfile = dataProvider.getItemAt(event.newIndex) as VideoProfile;
|
||||
if (userSession.userList.me.hasStream) {
|
||||
changeQualitySignal.dispatch(profile);
|
||||
} else {
|
||||
userSession.videoConnection.selectedCameraQuality = profile;
|
||||
}
|
||||
saveData.save("cameraQuality", userSession.videoConnection.selectedCameraQuality.id);
|
||||
displayPreviewCamera();
|
||||
}
|
||||
}
|
||||
|
||||
protected function displayPreviewCamera():void {
|
||||
}
|
||||
|
||||
protected function userChangeHandler(user:User, type:int):void {
|
||||
}
|
||||
|
||||
private function disableCam(disable:Boolean):void {
|
||||
if (disable) {
|
||||
// view.startCameraButton.enabled = false;
|
||||
} else {
|
||||
// view.startCameraButton.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected function setQualityListEnable(enabled:Boolean):void {
|
||||
view.cameraProfilesList.enabled = enabled;
|
||||
}
|
||||
|
||||
override public function destroy():void {
|
||||
super.destroy();
|
||||
userSession.lockSettings.disableCamSignal.remove(disableCam);
|
||||
userSession.userList.userChangeSignal.remove(userChangeHandler);
|
||||
view.cameraProfilesList.removeEventListener(ItemClickEvent.ITEM_CLICK, onCameraQualitySelected);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,27 @@
|
||||
package org.bigbluebutton.lib.settings.views.lock {
|
||||
import org.bigbluebutton.lib.main.models.IUserSession;
|
||||
|
||||
import robotlegs.bender.bundles.mvcs.Mediator;
|
||||
|
||||
public class LockSettingsViewMediatorBase extends Mediator {
|
||||
|
||||
[Inject]
|
||||
public var view:LockSettingsViewBase;
|
||||
|
||||
[Inject]
|
||||
public var userSession:IUserSession;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user