diff --git a/bigbluebutton-client/resources/config.xml.template b/bigbluebutton-client/resources/config.xml.template index ebf11800c4..0e95db8397 100755 --- a/bigbluebutton-client/resources/config.xml.template +++ b/bigbluebutton-client/resources/config.xml.template @@ -40,6 +40,7 @@ diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/BBB.as b/bigbluebutton-client/src/org/bigbluebutton/core/BBB.as index 9ec5538d4a..a545537d47 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/BBB.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/BBB.as @@ -38,6 +38,10 @@ package org.bigbluebutton.core return configManager; } + public static function getConfigForModule(module:String):XML { + return initConfigManager().config.getConfigFor(module); + } + public static function initStreamManager():StreamManager { if (streamManager == null) { streamManager = new StreamManager(); @@ -63,8 +67,7 @@ package org.bigbluebutton.core var versionString:String = Capabilities.version; var pattern:RegExp = /^(\w*) (\d*),(\d*),(\d*),(\d*)$/; var result:Object = pattern.exec(versionString); - if (result != null) - { + if (result != null) { // trace("input: " + result.input); // trace("platform: " + result[1]); // trace("majorVersion: " + result[2]); diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/managers/ConfigManager2.as b/bigbluebutton-client/src/org/bigbluebutton/core/managers/ConfigManager2.as index ab8422bb5f..170af3edf4 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/managers/ConfigManager2.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/managers/ConfigManager2.as @@ -11,14 +11,9 @@ package org.bigbluebutton.core.managers import org.bigbluebutton.core.EventBroadcaster; import org.bigbluebutton.core.model.Config; - public class ConfigManager2 extends EventDispatcher - { + public class ConfigManager2 extends EventDispatcher { private var _config:Config = null; - public function ConfigManager2() - { - } - public function loadConfig():void { var urlLoader:URLLoader = new URLLoader(); urlLoader.addEventListener(Event.COMPLETE, handleComplete); diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/model/Config.as b/bigbluebutton-client/src/org/bigbluebutton/core/model/Config.as index 2feaceff31..0d228b631a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/model/Config.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/model/Config.as @@ -78,7 +78,7 @@ package org.bigbluebutton.core.model return found; } - public function getModuleConfig(moduleName:String):XML { + public function getConfigFor(moduleName:String):XML { if (isModulePresent(moduleName)) { return new XML(config.modules.module.(@name.toUpperCase() == moduleName.toUpperCase()).toXMLString()); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/maps/ChatEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/maps/ChatEventMapDelegate.as index b0afc53060..4cbbd8c236 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/maps/ChatEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/maps/ChatEventMapDelegate.as @@ -49,7 +49,7 @@ package org.bigbluebutton.modules.chat.maps { } private function getChatOptions():void { - var cxml:XML = BBB.initConfigManager().config.getModuleConfig("ChatModule"); + var cxml:XML = BBB.getConfigForModule("ChatModule"); if (cxml != null) { chatOptions.privateEnabled = (cxml.@privateEnabled.toString().toUpperCase() == "TRUE") ? true : false; } @@ -65,13 +65,9 @@ package org.bigbluebutton.modules.chat.maps { // main application. var event:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT); event.window = _chatWindow; - globalDispatcher.dispatchEvent(event); - - _chatWindowOpen = true; - - dispatchTranslationOptions(); - - + globalDispatcher.dispatchEvent(event); + _chatWindowOpen = true; + dispatchTranslationOptions(); } public function closeChatWindow():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/managers/ListenersManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/managers/ListenersManager.as index ff9cc72348..ac30d9f215 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/managers/ListenersManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/listeners/managers/ListenersManager.as @@ -40,7 +40,7 @@ package org.bigbluebutton.modules.listeners.managers dispatcher = new Dispatcher(); listenerOptions = new ListenerOptions(); - var vxml:XML = BBB.initConfigManager().config.getModuleConfig("ListenersModule"); + var vxml:XML = BBB.getConfigForModule("ListenersModule"); if (vxml != null) { listenerOptions.windowVisible = (vxml.@windowVisible.toString().toUpperCase() == "TRUE") ? true : false; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as index 6dab88895e..eb0097b36d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/PhoneOptions.as @@ -1,13 +1,13 @@ package org.bigbluebutton.modules.phone { - public class PhoneOptions - { + public class PhoneOptions { [Bindable] public var showButton:Boolean = true; [Bindable] public var autoJoin:Boolean = false; - + [Bindable] + public var skipCheck:Boolean = false; } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as index a43a9ec89d..fe6d8f7a63 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as @@ -19,8 +19,7 @@ package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - + import com.asfusion.mate.events.Dispatcher; import flash.events.AsyncErrorEvent; import flash.events.Event; import flash.events.IEventDispatcher; @@ -28,8 +27,7 @@ package org.bigbluebutton.modules.phone.managers { import flash.events.SecurityErrorEvent; import flash.external.*; import flash.net.NetConnection; - import flash.net.NetStream; - + import flash.net.NetStream; import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.modules.phone.events.CallConnectedEvent; import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as index 83188c6976..6e69509702 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PhoneManager.as @@ -18,7 +18,12 @@ */ package org.bigbluebutton.modules.phone.managers { + import com.asfusion.mate.events.Dispatcher; + import org.bigbluebutton.common.LogUtil; + import org.bigbluebutton.core.BBB; + import org.bigbluebutton.main.events.BBBEvent; + import org.bigbluebutton.modules.phone.PhoneOptions; import org.bigbluebutton.modules.phone.events.CallConnectedEvent; public class PhoneManager { @@ -26,6 +31,7 @@ package org.bigbluebutton.modules.phone.managers { private var streamManager:StreamManager; private var onCall:Boolean = false; private var attributes:Object; + private var phoneOptions:PhoneOptions; public function PhoneManager() { connectionManager = new ConnectionManager(); @@ -34,7 +40,22 @@ package org.bigbluebutton.modules.phone.managers { public function setModuleAttributes(attributes:Object):void { this.attributes = attributes; - if (attributes.autoJoin == "true") joinVoice(true); + var vxml:XML = BBB.getConfigForModule("PhoneModule"); + phoneOptions = new PhoneOptions(); + if (vxml != null) { + phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; + } + + if (phoneOptions.autoJoin) { + if (phoneOptions.skipCheck) { + joinVoice(true); + } else { + var dispatcher:Dispatcher = new Dispatcher(); + dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); + } + } } private function setupMic(useMic:Boolean):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PreferencesManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PreferencesManager.as new file mode 100755 index 0000000000..9dcab1a659 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/PreferencesManager.as @@ -0,0 +1,22 @@ +package org.bigbluebutton.modules.phone.managers +{ + import flash.events.EventDispatcher; + import org.bigbluebutton.core.events.ErrorEvent; + + public class PreferencesManager extends EventDispatcher { + private static var sharedObject:SharedObject = SharedObject.getLocal("BBBUserPreferences", "/"); + + public function savePreference(key:String, value:Object):void{ + sharedObject.data[key] = value; + try{ + sharedObject.flush(1000); + } catch(err:Error){ + dispatchEvent(new ErrorEvent("SavingErrorEvent", true, true)); + } + } + + public function getPreference(key:String):Object { + return sharedObject.data[key]; + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as index 17b2976258..2f3b47e95e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/StreamManager.as @@ -18,8 +18,7 @@ */ package org.bigbluebutton.modules.phone.managers { - import com.asfusion.mate.events.Dispatcher; - + import com.asfusion.mate.events.Dispatcher; import flash.events.ActivityEvent; import flash.events.AsyncErrorEvent; import flash.events.IEventDispatcher; @@ -77,6 +76,8 @@ package org.bigbluebutton.modules.phone.managers { options.echoPath = 128; options.nonLinearProcessing = true; mic['enhancedOptions'] = options; + } else { + } mic.setUseEchoSuppression(true); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as index ba21d210b9..099cb0daea 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/maps/PhoneEventMapDelegate.as @@ -37,10 +37,11 @@ package org.bigbluebutton.modules.phone.maps phoneButton = new ToolbarButton(); globalDispatcher = new Dispatcher(); phoneOptions = new PhoneOptions(); - var vxml:XML = BBB.initConfigManager().config.getModuleConfig("PhoneModule"); + var vxml:XML = BBB.getConfigForModule("PhoneModule"); if (vxml != null) { phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; } } 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 f9e11cf4d0..d556e46474 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 @@ -35,8 +35,10 @@ import com.asfusion.mate.events.Dispatcher; import org.bigbluebutton.common.LogUtil; + import org.bigbluebutton.core.BBB; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.views.MainToolbar; + import org.bigbluebutton.modules.phone.PhoneOptions; import org.bigbluebutton.modules.phone.events.CallConnectedEvent; import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent; import org.bigbluebutton.modules.phone.views.assets.Images; @@ -49,12 +51,26 @@ private function startPhone():void { if (this.selected) { - dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); + var vxml:XML = BBB.getConfigForModule("PhoneModule"); + var phoneOptions:PhoneOptions = new PhoneOptions(); + if (vxml != null) { + phoneOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.autoJoin = (vxml.@autoJoin.toString().toUpperCase() == "TRUE") ? true : false; + phoneOptions.skipCheck = (vxml.@skipCheck.toString().toUpperCase() == "TRUE") ? true : false; + } + this.enabled = false; + if (phoneOptions.skipCheck) { + var joinEvent:BBBEvent = new BBBEvent("JOIN_VOICE_CONFERENCE_EVENT"); + joinEvent.payload['useMicrophone'] = false; + dispatcher.dispatchEvent(joinEvent); + } else { + dispatcher.dispatchEvent(new BBBEvent("SHOW_MIC_SETTINGS")); + } } else { dispatcher.dispatchEvent(new BBBEvent("LEAVE_VOICE_CONFERENCE_EVENT")); } - this.enabled = false; + var t:Timer = new Timer(3000, 1); t.addEventListener(TimerEvent.TIMER, onTimer); t.start(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as index 395a715742..67c86d04d1 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as @@ -38,7 +38,7 @@ package org.bigbluebutton.modules.videoconf.model public var camQualityPicture:Number = 50; public function parseOptions():void { - var vxml:XML = BBB.initConfigManager().config.getModuleConfig("VideoconfModule"); + var vxml:XML = BBB.getConfigForModule("VideoconfModule"); if (vxml != null) { if (vxml.@showButton != undefined) { showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/viewers/managers/ViewersManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/viewers/managers/ViewersManager.as index 5b05c44f6d..c0609ec717 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/viewers/managers/ViewersManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/viewers/managers/ViewersManager.as @@ -47,7 +47,7 @@ package org.bigbluebutton.modules.viewers.managers viewerOptions = new ViewerOptions(); - var vxml:XML = BBB.initConfigManager().config.getModuleConfig("ViewersModule"); + var vxml:XML = BBB.getConfigForModule("ViewersModule"); if (vxml != null) { viewerOptions.windowVisible = (vxml.@windowVisible.toString().toUpperCase() == "TRUE") ? true : false; }