diff --git a/bigbluebutton-client/src/VideoconfModule.mxml b/bigbluebutton-client/src/VideoconfModule.mxml old mode 100644 new mode 100755 index c7367b841a574aca7d9f13e44878b5cf30670e18..84db72a2681d2cf900ca56f043e90a6647afab60 --- a/bigbluebutton-client/src/VideoconfModule.mxml +++ b/bigbluebutton-client/src/VideoconfModule.mxml @@ -44,38 +44,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. return _moduleName; } - public function get uri():String { - return _attributes.uri + "/" + _attributes.room; - } - - public function get username():String { - return _attributes.username; - } - - public function get mode():String { - if (_attributes.mode == null) { - //_attributes.mode = "PLAYBACK" - _attributes.mode = "LIVE" - LOGGER.debug('Setting NotesModule mode: {0}', [_attributes.mode]); - } - LOGGER.debug('VideoconfVModule mode: {0}', [_attributes.mode]); - return _attributes.mode; - } - - public function get userid():String { - return _attributes.userid as String; - } - - public function get role():String { - return _attributes.userrole as String; - } - public function start(attributes:Object):void { LOGGER.debug("Starting Video Module"); _attributes = attributes; var globalDispatcher:Dispatcher = new Dispatcher(); var event:VideoModuleStartEvent = new VideoModuleStartEvent(VideoModuleStartEvent.START); - event.uri = uri; globalDispatcher.dispatchEvent(event); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as index c634e8a9d6cdd2b30b4ffc9aab6f43d5060feae3..32564b27f6dd38ddf215dd40d745d43534d1bd7d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as @@ -43,6 +43,7 @@ package org.bigbluebutton.modules.videoconf.business import org.bigbluebutton.modules.videoconf.events.StartBroadcastEvent; import org.bigbluebutton.modules.videoconf.events.StopBroadcastEvent; import org.bigbluebutton.modules.videoconf.model.VideoConfOptions; + import org.bigbluebutton.util.ConnUtil; public class VideoProxy @@ -50,14 +51,12 @@ package org.bigbluebutton.modules.videoconf.business private static const LOGGER:ILogger = getClassLogger(VideoProxy); public var videoOptions:VideoConfOptions; - private var nc:NetConnection; - private var _url:String; private var camerasPublishing:Object = new Object(); private var reconnect:Boolean = false; private var reconnecting:Boolean = false; private var dispatcher:Dispatcher = new Dispatcher(); - + private var vidoeConnUrl: String; private var numNetworkChangeCount:int = 0; private function parseOptions():void { @@ -65,13 +64,11 @@ package org.bigbluebutton.modules.videoconf.business videoOptions.parseOptions(); } - public function VideoProxy(url:String) + public function VideoProxy() { - _url = url; parseOptions(); nc = new NetConnection(); nc.objectEncoding = ObjectEncoding.AMF3; - nc.proxyType = "best"; nc.client = this; nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError); nc.addEventListener(IOErrorEvent.IO_ERROR, onIOError); @@ -84,7 +81,36 @@ package org.bigbluebutton.modules.videoconf.business } public function connect():void { - nc.connect(_url, UsersUtil.getInternalMeetingID(), + var options: VideoConfOptions = Options.getOptions(VideoConfOptions) as VideoConfOptions; + var pattern:RegExp = /(?P<protocol>.+):\/\/(?P<server>.+)\/(?P<app>.+)/; + var result:Array = pattern.exec(options.uri); + + + var useRTMPS: Boolean = result.protocol == ConnUtil.RTMPS; + if (BBB.initConnectionManager().isTunnelling) { + var tunnelProtocol: String = ConnUtil.RTMPT; + + if (useRTMPS) { + nc.proxyType = ConnUtil.PROXY_NONE; + tunnelProtocol = ConnUtil.RTMPS; + } + + + vidoeConnUrl = tunnelProtocol + "://" + result.server + "/" + result.app; + trace("******* VIDEO CONNECT tunnel = TRUE " + "url=" + vidoeConnUrl); + } else { + var nativeProtocol: String = ConnUtil.RTMP; + if (useRTMPS) { + nc.proxyType = ConnUtil.PROXY_BEST; + nativeProtocol = ConnUtil.RTMPS; + } + + vidoeConnUrl = nativeProtocol + "://" + result.server + "/" + result.app; + trace("******* VIDEO CONNECT tunnel = FALSE " + "url=" + vidoeConnUrl); + } + + + nc.connect(vidoeConnUrl, UsersUtil.getInternalMeetingID(), UsersUtil.getMyUserID(), LiveMeeting.inst().me.authToken); } @@ -115,7 +141,7 @@ package org.bigbluebutton.modules.videoconf.business private function onNetStatus(event:NetStatusEvent):void{ - LOGGER.debug("[{0}] for [{1}]", [event.info.code, _url]); + LOGGER.debug("[{0}] for [{1}]", [event.info.code, vidoeConnUrl]); var logData:Object = UsersUtil.initLogData(); logData.tags = ["webcam"]; logData.user.eventCode = event.info.code + "[reconnecting=" + reconnecting + ",reconnect=" + reconnect + "]"; @@ -179,7 +205,7 @@ package org.bigbluebutton.modules.videoconf.business } break; default: - LOGGER.debug("[{0}] for [{1}]", [event.info.code, _url]); + LOGGER.debug("[{0}] for [{1}]", [event.info.code, vidoeConnUrl]); break; } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/events/VideoModuleStartEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/events/VideoModuleStartEvent.as index 6f394e3c084de1502447a54ef3f7bd8c01e09693..f82f2a746cae9aaba4f2b3afee3ac8efd4462e55 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/events/VideoModuleStartEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/events/VideoModuleStartEvent.as @@ -24,8 +24,6 @@ package org.bigbluebutton.modules.videoconf.events { public static const START:String = "video module start event"; - public var uri:String; - public function VideoModuleStartEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) { super(type, bubbles, cancelable); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml index 2ec35ab8d59c9119782235ea0431e54f523167b6..c681c1888a7734fd227045afd4242b194cf666c1 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMap.mxml @@ -46,7 +46,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <fx:Declarations> <EventHandlers type="{VideoModuleStartEvent.START}"> <ObjectBuilder generator="{VideoEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/> - <MethodInvoker generator="{VideoEventMapDelegate}" method="start" arguments="{event.uri}"/> + <MethodInvoker generator="{VideoEventMapDelegate}" method="start"/> <EventAnnouncer generator="{ConnectAppEvent}" type="{ConnectAppEvent.CONNECT_VIDEO_APP}" /> </EventHandlers> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as index 47f2d520d056ffdf34009a01c941b809d22b534b..80e50ca148f7b95bf330d61bb12d6bcc95035fc5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/maps/VideoEventMapDelegate.as @@ -66,7 +66,6 @@ package org.bigbluebutton.modules.videoconf.maps private static var PERMISSION_DENIED_ERROR:String = "PermissionDeniedError"; private var options:VideoConfOptions; - private var uri:String; private var button:ToolbarPopupButton = new ToolbarPopupButton(); private var proxy:VideoProxy; @@ -98,9 +97,8 @@ package org.bigbluebutton.modules.videoconf.maps return UsersUtil.getMyUsername(); } - public function start(uri:String):void { + public function start():void { LOGGER.debug("VideoEventMapDelegate:: [{0}] Video Module Started.", [me]); - this.uri = uri; _videoDock = new VideoDock(); var windowEvent:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT); @@ -303,7 +301,7 @@ package org.bigbluebutton.modules.videoconf.maps } public function connectToVideoApp():void { - proxy = new VideoProxy(uri); + proxy = new VideoProxy(); proxy.reconnectWhenDisconnected(true); proxy.connect(); }