From e789d1440dfc7645dfbfc879e7cac27e143a25c1 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Fri, 19 Jan 2018 12:16:47 -0800 Subject: [PATCH] - determine screenshare connection type --- .../src/ScreenshareModule.mxml | 50 +----------- .../src/ScreenshareStandalone.mxml | 2 +- .../main/model/users/NetConnectionDelegate.as | 10 +-- .../managers/PublishWindowManager.as | 4 +- .../managers/ScreenshareManager.as | 4 +- .../managers/WebRTCViewerWindowManager.as | 4 +- .../screenshare/model/ScreenshareOptions.as | 3 + .../services/ScreenshareService.as | 18 ++--- .../services/WebRTCDeskshareService.as | 11 +-- .../screenshare/services/red5/Connection.as | 79 +++++++++++-------- .../components/ScreensharePublishWindow.mxml | 67 ++++++++-------- .../components/WebRTCDesktopViewWindow.mxml | 35 +++++++- 12 files changed, 130 insertions(+), 157 deletions(-) mode change 100644 => 100755 bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/WebRTCViewerWindowManager.as diff --git a/bigbluebutton-client/src/ScreenshareModule.mxml b/bigbluebutton-client/src/ScreenshareModule.mxml index 070d39731a..78f2b37a17 100755 --- a/bigbluebutton-client/src/ScreenshareModule.mxml +++ b/bigbluebutton-client/src/ScreenshareModule.mxml @@ -41,7 +41,6 @@ with BigBlueButton; if not, see . private static const LOGGER:ILogger = getClassLogger(ScreenshareModule); private var _moduleName:String = "Desk Share"; - private var _attributes:Object; private var globalDispatcher:Dispatcher = new Dispatcher();; @@ -53,35 +52,9 @@ with BigBlueButton; if not, see . return _moduleName; } - public function get uri():String{ - return _attributes.uri; - } - - public function get username():String{ - return _attributes.username; - } - - public function get mode():String{ - if (_attributes.mode == null){ - _attributes.mode = "LIVE"; - LOGGER.debug("Setting DeskShare mode: " + _attributes.mode); - } - LOGGER.debug("DeskShare mode: " + _attributes.mode); - return _attributes.mode; - } - - public function get userid():Number{ - return _attributes.userid as Number; - } - - public function get role():String{ - return _attributes.userrole as String; - } - public function start(attributes:Object):void{ LOGGER.debug("desk share attr: " + attributes.username); - _attributes = attributes; - + var startEvent:ModuleEvent = new ModuleEvent(ModuleEvent.START); startEvent.module = this; globalDispatcher.dispatchEvent(startEvent); @@ -93,27 +66,6 @@ with BigBlueButton; if not, see . globalDispatcher.dispatchEvent(stopEvent); } - public function getRoom():String{ - return _attributes.room; - } - - public function getRed5ServerUri():String{ - return _attributes.uri; - } - - public function getCaptureServerUri():String{ - var uri:String = _attributes.uri; - uri = uri.split("/")[2]; - return uri; - } - - public function tunnel():Boolean { - if (_attributes.protocol == "RTMPT") { - LOGGER.debug("Use tunneling for desktop sharing"); - return true; - } - return false; - } ]]> diff --git a/bigbluebutton-client/src/ScreenshareStandalone.mxml b/bigbluebutton-client/src/ScreenshareStandalone.mxml index 77adf063a5..741e8b75b0 100755 --- a/bigbluebutton-client/src/ScreenshareStandalone.mxml +++ b/bigbluebutton-client/src/ScreenshareStandalone.mxml @@ -72,7 +72,7 @@ with BigBlueButton; if not, see . logoutURL = p.getParameter("LOGOUTURL"); host = p.getParameter("HOST"); room = p.getParameter("ROOM"); - service.connect(host, room); + service.connect(); cursor.graphics.lineStyle(6, 0xFF0000, 0.6); cursor.graphics.drawCircle(0,0,3); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as index 9362b7399b..6ab4097d45 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as @@ -29,9 +29,7 @@ package org.bigbluebutton.main.model.users import flash.net.ObjectEncoding; import flash.net.Responder; import flash.utils.Timer; - import mx.utils.ObjectUtil; - import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.core.BBB; @@ -44,7 +42,6 @@ package org.bigbluebutton.main.model.users import org.bigbluebutton.core.events.TokenValidReconnectEvent; import org.bigbluebutton.core.managers.ReconnectionManager; import org.bigbluebutton.core.model.LiveMeeting; - import org.bigbluebutton.core.services.BandwidthMonitor; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.events.InvalidAuthTokenEvent; import org.bigbluebutton.main.model.options.ApplicationOptions; @@ -415,7 +412,7 @@ package org.bigbluebutton.main.model.users var pattern:RegExp = /(?P.+):\/\/(?P.+)\/(?P.+)/; var result:Array = pattern.exec(appURL); - var uri:String = appURL + "/" + intMeetingId; + var useRTMPS: Boolean = result.protocol == ConnUtil.RTMPS; if (BBB.initConnectionManager().isTunnelling) { @@ -467,15 +464,14 @@ package org.bigbluebutton.main.model.users recorded, extUserId, intUserId, muteOnStart, guest, authToken); - } catch(e:ArgumentError) { // Invalid parameters. switch (e.errorID) { case 2004 : - LOGGER.debug("Error! Invalid server location: {0}", [uri]); + LOGGER.debug("Error! Invalid server location: {0}", [bbbAppsUrl]); break; default : - LOGGER.debug("UNKNOWN Error! Invalid server location: {0}", [uri]); + LOGGER.debug("UNKNOWN Error! Invalid server location: {0}", [bbbAppsUrl]); break; } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/PublishWindowManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/PublishWindowManager.as index 603f6e4fd5..9c1141d49b 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/PublishWindowManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/PublishWindowManager.as @@ -46,11 +46,11 @@ package org.bigbluebutton.modules.screenshare.managers { if (shareWindow != null) shareWindow.stopSharing(); } - public function startSharing(uri:String, room:String, tunnel:Boolean):void { + public function startSharing():void { LOGGER.debug("DS:PublishWindowManager::opening desk share window"); if (shareWindow == null) { shareWindow = new ScreensharePublishWindow(); - shareWindow.initWindow(service.getConnection(), uri, room, tunnel); + shareWindow.initWindow(service.getConnection()); shareWindow.visible = true; openWindow(shareWindow); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as index 031bbe8f8f..1734b5675c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as @@ -152,7 +152,7 @@ package org.bigbluebutton.modules.screenshare.managers { if (force || (options.tryWebRTCFirst && !BrowserCheck.isWebRTCSupported()) || !options.tryWebRTCFirst) { usingJava = true; - publishWindowManager.startSharing(module.getCaptureServerUri(), module.getRoom(), BBB.initConnectionManager().isTunnelling); + publishWindowManager.startSharing(); sharing = true; service.requestShareToken(); } else { @@ -200,7 +200,7 @@ package org.bigbluebutton.modules.screenshare.managers { public function handleStartSharingEvent():void { //toolbarButtonManager.disableToolbarButton(); toolbarButtonManager.startedSharing(); - publishWindowManager.startSharing(module.getCaptureServerUri(), module.getRoom(), module.tunnel()); + publishWindowManager.startSharing(); sharing = true; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/WebRTCViewerWindowManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/WebRTCViewerWindowManager.as old mode 100644 new mode 100755 index 2a04b8b8d5..8b50204f65 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/WebRTCViewerWindowManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/WebRTCViewerWindowManager.as @@ -34,12 +34,12 @@ package org.bigbluebutton.modules.screenshare.managers private var viewWindow:WebRTCDesktopViewWindow; private var shareWindow:WebRTCDesktopPublishWindow; - private var service:WebRTCDeskshareService; + private var isViewing:Boolean = false; private var globalDispatcher:Dispatcher; public function WebRTCViewerWindowManager(service:WebRTCDeskshareService) { - this.service = service; + globalDispatcher = new Dispatcher(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/model/ScreenshareOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/model/ScreenshareOptions.as index 902dbffbf6..a90b6eaaf1 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/model/ScreenshareOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/model/ScreenshareOptions.as @@ -21,6 +21,9 @@ package org.bigbluebutton.modules.screenshare.model { public class ScreenshareOptions extends Options { + [Bindable] + public var uri: String = ""; + [Bindable] public var showButton:Boolean = true; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/ScreenshareService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/ScreenshareService.as index 7cf8a147f3..321f4bf92f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/ScreenshareService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/ScreenshareService.as @@ -18,8 +18,7 @@ */ package org.bigbluebutton.modules.screenshare.services { import com.asfusion.mate.events.Dispatcher; - - import flash.net.NetConnection; + import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.core.UsersUtil; @@ -39,9 +38,7 @@ package org.bigbluebutton.modules.screenshare.services { private var module:ScreenshareModule; private var dispatcher:Dispatcher; - - private var uri:String; - private var room:String; + private var sender:MessageSender; private var receiver:MessageReceiver; @@ -52,19 +49,14 @@ package org.bigbluebutton.modules.screenshare.services { public function handleStartModuleEvent(module:ScreenshareModule):void { LOGGER.debug("Screenshare Module starting"); this.module = module; - connect(module.uri, module.getRoom()); + connect(); } - public function connect(uri:String, room:String):void { - this.uri = uri; - this.room = room; - LOGGER.debug("Screenshare Service connecting to " + uri); - conn = new Connection(room); - + public function connect():void { + conn = new Connection(); sender = new MessageSender(conn); receiver = new MessageReceiver(conn); - conn.setURI(uri); conn.connect(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/WebRTCDeskshareService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/WebRTCDeskshareService.as index 7bdefe4f66..a0b6fc0ae4 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/WebRTCDeskshareService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/WebRTCDeskshareService.as @@ -37,13 +37,10 @@ package org.bigbluebutton.modules.screenshare.services private var sender:MessageSender; - private var uri:String; - private var room:String; - public function WebRTCDeskshareService() { this.dispatcher = new Dispatcher(); - red5conn = new Connection(room); + red5conn = new Connection(); sender = new MessageSender(red5conn); sender.queryForScreenshare(); } @@ -51,14 +48,8 @@ package org.bigbluebutton.modules.screenshare.services public function handleStartModuleEvent(module:ScreenshareModule):void { LOGGER.debug("Deskshare Module starting"); this.module = module; - connect(module.uri, module.getRoom()); } - public function connect(uri:String, room:String):void { - this.uri = uri; - this.room = room; - LOGGER.debug("Deskshare Service connecting to {0}", [uri]); - } public function getConnection():NetConnection{ return red5conn.getConnection(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as index 3a757b72cb..427b0d7f4c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as @@ -19,62 +19,79 @@ package org.bigbluebutton.modules.screenshare.services.red5 { import com.asfusion.mate.events.Dispatcher; - import flash.events.NetStatusEvent; import flash.events.SecurityErrorEvent; import flash.net.NetConnection; import flash.net.ObjectEncoding; import flash.net.Responder; - import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.core.BBB; + import org.bigbluebutton.core.Options; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.managers.ReconnectionManager; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.modules.screenshare.events.ViewStreamEvent; import org.bigbluebutton.modules.screenshare.model.ScreenshareModel; + import org.bigbluebutton.modules.screenshare.model.ScreenshareOptions; + import org.bigbluebutton.util.ConnUtil; public class Connection { private static const LOGGER:ILogger = getClassLogger(Connection); private var netConnection:NetConnection; - private var uri:String; private var responder:Responder; private var width:Number; private var height:Number; - private var meetingId:String; - + private var dispatcher:Dispatcher = new Dispatcher(); private var _messageListeners:Array = new Array(); private var logoutOnUserCommand:Boolean = false; private var reconnecting:Boolean = false; - - public function Connection(meetingId:String) { - this.meetingId = meetingId; - } + private var ssAppUrl: String = null; + public function connect():void { - var isTunnelling:Boolean = BBB.initConnectionManager().isTunnelling; - if (isTunnelling) { - uri = uri.replace(/rtmp:/gi, "rtmpt:"); - } - NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF3; - netConnection = new NetConnection(); - netConnection.proxyType = "best"; + netConnection = new NetConnection(); + netConnection.objectEncoding = ObjectEncoding.AMF3; + + var options: ScreenshareOptions = Options.getOptions(ScreenshareOptions) as ScreenshareOptions; + var appURL: String = options.uri; + + var pattern:RegExp = /(?P.+):\/\/(?P.+)\/(?P.+)/; + var result:Array = pattern.exec(appURL); + + var useRTMPS: Boolean = result.protocol == ConnUtil.RTMPS; + + if (BBB.initConnectionManager().isTunnelling) { + var tunnelProtocol: String = ConnUtil.RTMPT; + + if (useRTMPS) { + netConnection.proxyType = ConnUtil.PROXY_NONE; + tunnelProtocol = ConnUtil.RTMPS; + } + + + ssAppUrl = tunnelProtocol + "://" + result.server + "/" + result.app + "/" + UsersUtil.getInternalMeetingID(); + trace("******* SCREENSHARE CONNECT tunnel = TRUE " + "url=" + ssAppUrl); + } else { + var nativeProtocol: String = ConnUtil.RTMP; + if (useRTMPS) { + netConnection.proxyType = ConnUtil.PROXY_BEST; + nativeProtocol = ConnUtil.RTMPS; + } + + ssAppUrl = nativeProtocol + "://" + result.server + "/" + result.app + "/" + UsersUtil.getInternalMeetingID(); + trace("******* SCREENSHARE CONNECT tunnel = FALSE " + "url=" + ssAppUrl); + } + netConnection.client = this; netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatusHandler); netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); - // uri may include internal meetingId if we are reconnecting - var internalMeetingID:String = UsersUtil.getInternalMeetingID(); - if (uri.indexOf(internalMeetingID) == -1) { - uri = uri + "/" + internalMeetingID; - } - - LOGGER.debug("Connecting to uri=[{0}]", [uri]); - netConnection.connect(uri); + LOGGER.debug("Connecting to uri=[{0}]", [ssAppUrl]); + netConnection.connect(ssAppUrl); } @@ -215,11 +232,7 @@ package org.bigbluebutton.modules.screenshare.services.red5 { // LOGGER.error(status); }, message); } - - public function setURI(p_URI:String):void { - uri = p_URI; - } - + public function onBWCheck(... rest):Number { return 0; } @@ -234,7 +247,7 @@ package org.bigbluebutton.modules.screenshare.services.red5 { private function sendUserIdToServer():void { var message:Object = new Object(); - message["meetingId"] = meetingId; + message["meetingId"] = UsersUtil.getInternalMeetingID(); message["userId"] = UsersUtil.getMyUserID(); sendMessage("screenshare.setUserId", function(result:String):void { // On successful result @@ -250,7 +263,7 @@ package org.bigbluebutton.modules.screenshare.services.red5 { } private function netStatusHandler(event:NetStatusEvent):void { - LOGGER.debug("Connected to [" + uri + "]. [" + event.info.code + "]"); + LOGGER.debug("Connected to [" + ssAppUrl + "]. [" + event.info.code + "]"); var ce:ConnectionEvent; switch (event.info.code) { @@ -332,11 +345,11 @@ package org.bigbluebutton.modules.screenshare.services.red5 { } public function connectionFailedHandler(e:ConnectionEvent):void { - LOGGER.error("connection failed to " + uri + " with message " + e.toString()); + LOGGER.error("connection failed to " + ssAppUrl + " with message " + e.toString()); } public function connectionRejectedHandler(e:ConnectionEvent):void { - LOGGER.error("connection rejected " + uri + " with message " + e.toString()); + LOGGER.error("connection rejected " + ssAppUrl + " with message " + e.toString()); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml index 7917b91f8c..783620c261 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml @@ -49,32 +49,33 @@ with BigBlueButton; if not, see . . private static const VID_WIDTH_PAD:Number = 6; private var connection:Connection; - private var uri:String; - private var room:String; - private var tunnel:Boolean = false; private var sharingFullScreen:Boolean = false; private var streaming:Boolean = false; @@ -137,7 +135,7 @@ with BigBlueButton; if not, see . focusManager.setFocus(titleBarOverlay); - if (tunnel) { + if (BBB.initConnectionManager().isTunnelling) { helpInfoBox.visible = helpInfoBox.includeInLayout = false; previewBox.visible = previewBox.includeInLayout = false; tunnelBox.visible = tunnelBox.includeInLayout = true; @@ -188,11 +186,8 @@ with BigBlueButton; if not, see . */ public function resetWidthAndHeight():void{/* do nothing */} - public function initWindow(connection:Connection, uri:String, room:String, tunnel:Boolean):void { + public function initWindow(connection:Connection):void { this.connection = connection; - this.uri = uri; - this.room = room; - this.tunnel = tunnel; } private function handleStartShareRequestSuccessEvent(event:StartShareRequestSuccessEvent):void { @@ -258,10 +253,10 @@ with BigBlueButton; if not, see . startBtn.enabled = false; var shareStartEvent:ShareStartEvent = new ShareStartEvent(); dispatchEvent(shareStartEvent); - startSharing(connection.getConnection(), uri, room, fullScreen); + startSharing(connection.getConnection(), fullScreen); } - private function startSharing(connection:NetConnection, uri:String, room:String, fullScreen:Boolean):void { + private function startSharing(connection:NetConnection, fullScreen:Boolean):void { var captureX:Number = 0; var captureY:Number = 0; sharingFullScreen = fullScreen; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml index a21eb5b994..759c811bfb 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml @@ -47,12 +47,15 @@ with BigBlueButton; if not, see . import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.common.IBbbModuleWindow; import org.bigbluebutton.common.events.LocaleChangeEvent; + import org.bigbluebutton.core.BBB; import org.bigbluebutton.core.Options; + import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.main.views.MainCanvas; import org.bigbluebutton.modules.screenshare.events.ViewStreamEvent; import org.bigbluebutton.modules.screenshare.events.ViewWindowEvent; import org.bigbluebutton.modules.screenshare.model.ScreenshareOptions; import org.bigbluebutton.modules.screenshare.services.red5.WebRTCConnectionEvent; + import org.bigbluebutton.util.ConnUtil; import org.bigbluebutton.util.i18n.ResourceUtil; public static const LOG:String = "Deskshare::DesktopViewWindow - "; @@ -130,13 +133,41 @@ with BigBlueButton; if not, see . public function connect(rtmpUrl: String):void { nc = new NetConnection(); - nc.proxyType = "best"; + + var pattern:RegExp = /(?P.+):\/\/(?P.+)/; + var result:Array = pattern.exec(rtmpUrl); + + var useRTMPS: Boolean = result.protocol == ConnUtil.RTMPS; + var ssAppUrl: String = null; + + if (BBB.initConnectionManager().isTunnelling) { + var tunnelProtocol: String = ConnUtil.RTMPT; + + if (useRTMPS) { + nc.proxyType = ConnUtil.PROXY_NONE; + tunnelProtocol = ConnUtil.RTMPS; + } + + + ssAppUrl = tunnelProtocol + "://" + result.serverAndApp; + trace("******* WEBRTC SSHARE CONNECT tunnel = TRUE " + "url=" + ssAppUrl); + } else { + var nativeProtocol: String = ConnUtil.RTMP; + if (useRTMPS) { + nc.proxyType = ConnUtil.PROXY_BEST; + nativeProtocol = ConnUtil.RTMPS; + } + + ssAppUrl = nativeProtocol + "://" + result.serverAndApp; + trace("******* WEBRTC SSHARE CONNECT tunnel = FALSE " + "url=" + ssAppUrl); + } + nc.objectEncoding = ObjectEncoding.AMF3; nc.client = this; nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); - nc.connect(rtmpUrl); + nc.connect(ssAppUrl); } public function connectionSuccessHandler():void{