- 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 static const LOG:String = "Deskshare::Connection - ";
private var nc:NetConnection;
private var uri:String;
private var nc:NetConnection;
private var uri:String;
private var retryTimer:Timer = null;
private var retryCount:int = 0;
private const MAX_RETRIES:int = 5;
@ -248,7 +248,6 @@ package org.bigbluebutton.modules.deskshare.services.red5
break;
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.");
break;
@ -334,10 +333,13 @@ package org.bigbluebutton.modules.deskshare.services.red5
*/
public function appletStarted(videoWidth:Number, videoHeight:Number):void{
trace(LOG + "Got applet started");
var event:AppletStartedEvent = new AppletStartedEvent();
event.videoWidth = videoWidth;
event.videoHeight = videoHeight;
dispatcher.dispatchEvent(event);
if (nc != null && nc.connected) {
var event:AppletStartedEvent = new AppletStartedEvent();
event.videoWidth = videoWidth;
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{
if (!connection.connected) return;
trace("DeskShareWindow::onAppletStart");
startPreviewStream(connection, room, event.videoWidth, event.videoHeight);
var streamEvent:StreamEvent = new StreamEvent(StreamEvent.START);