- make sure we are connected first before vieweing deskshare stream

This commit is contained in:
Richard Alam 2015-07-24 19:59:54 +00:00
parent 7ee48e9397
commit 6a1a7e796a
2 changed files with 11 additions and 7 deletions

View File

@ -45,8 +45,8 @@ package org.bigbluebutton.modules.deskshare.services.red5
public class Connection { public class Connection {
public static const LOG:String = "Deskshare::Connection - "; public static const LOG:String = "Deskshare::Connection - ";
private var nc:NetConnection; private var nc:NetConnection;
private var uri:String; private var uri:String;
private var retryTimer:Timer = null; private var retryTimer:Timer = null;
private var retryCount:int = 0; private var retryCount:int = 0;
private const MAX_RETRIES:int = 5; private const MAX_RETRIES:int = 5;
@ -248,7 +248,6 @@ package org.bigbluebutton.modules.deskshare.services.red5
break; break;
case "NetConnection.Connect.NetworkChange": case "NetConnection.Connect.NetworkChange":
LogUtil.info("Detected network change. User might be on a wireless and temporarily dropped connection. Doing nothing. Just making a note.");
trace(LOG + "Detected network change. User might be on a wireless and temporarily dropped connection. Doing nothing. Just making a note."); trace(LOG + "Detected network change. User might be on a wireless and temporarily dropped connection. Doing nothing. Just making a note.");
break; break;
@ -334,10 +333,13 @@ package org.bigbluebutton.modules.deskshare.services.red5
*/ */
public function appletStarted(videoWidth:Number, videoHeight:Number):void{ public function appletStarted(videoWidth:Number, videoHeight:Number):void{
trace(LOG + "Got applet started"); trace(LOG + "Got applet started");
var event:AppletStartedEvent = new AppletStartedEvent(); if (nc != null && nc.connected) {
event.videoWidth = videoWidth; var event:AppletStartedEvent = new AppletStartedEvent();
event.videoHeight = videoHeight; event.videoWidth = videoWidth;
dispatcher.dispatchEvent(event); event.videoHeight = videoHeight;
dispatcher.dispatchEvent(event);
}
} }
/** /**

View File

@ -242,6 +242,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} }
private function onAppletStart(event:AppletStartedEvent):void{ private function onAppletStart(event:AppletStartedEvent):void{
if (!connection.connected) return;
trace("DeskShareWindow::onAppletStart"); trace("DeskShareWindow::onAppletStart");
startPreviewStream(connection, room, event.videoWidth, event.videoHeight); startPreviewStream(connection, room, event.videoWidth, event.videoHeight);
var streamEvent:StreamEvent = new StreamEvent(StreamEvent.START); var streamEvent:StreamEvent = new StreamEvent(StreamEvent.START);