- clear video holder when presenter stops sharing video

This commit is contained in:
Richard Alam 2012-12-14 21:01:17 +00:00
parent 2294c6300e
commit 1cd749290b
3 changed files with 29 additions and 3 deletions

View File

@ -151,7 +151,19 @@ $Id: $
connect(url);
}
public function handleStopViewCamera():void {
private function handleStopViewCamera():void {
stopViewing();
}
private function stopViewing():void {
if (_video != null) {
trace("WebcamViewSA:: removing video from holder");
_videoHolder.removeChild(_video);
_video.clear();
_video = null;
}
_videoHolder.visible = false;
trace("WebcamViewSA:: closing stream");
ns.close();
}
@ -190,6 +202,7 @@ $Id: $
_videoHolder.addChild(_video);
_videoHolder.visible = true;
ns.play(_stream);
}
@ -207,10 +220,11 @@ $Id: $
private function onNetStatus(e:NetStatusEvent):void{
switch(e.info.code){
case "NetStream.Publish.Start":
trace("WebcamViewSA:: NetStream.Publish.Start for broadcast stream ");
trace("WebcamViewSA:: NetStream.Publish.Start");
break;
case "NetStream.Play.UnpublishNotify":
ns.close();
trace("WebcamViewSA:: NetStream.Play.UnpublishNotify");
stopViewing();
break;
case "NetStream.Play.Start":
trace("WebcamViewSA:: Netstatus: " + e.info.code);

View File

@ -15,6 +15,7 @@ package org.bigbluebutton.main.api
import org.bigbluebutton.main.events.UserLeftEvent;
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
import org.bigbluebutton.main.model.users.events.BroadcastStoppedEvent;
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
@ -33,6 +34,12 @@ package org.bigbluebutton.main.api
broadcastEvent(payload);
}
public function handleBroadcastStoppedEvent(event:BroadcastStoppedEvent):void {
var payload:Object = new Object();
payload.eventName = EventConstants.BROADCASTING_CAM_STOPPED;
broadcastEvent(payload);
}
public function handleBroadcastStartedEvent(event:BroadcastStartedEvent):void {
var vidConf:VideoConfOptions = new VideoConfOptions();

View File

@ -32,6 +32,7 @@
import org.bigbluebutton.main.events.UserJoinedEvent;
import org.bigbluebutton.main.events.UserLeftEvent;
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
import org.bigbluebutton.main.model.users.events.BroadcastStoppedEvent;
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
]]>
</mx:Script>
@ -48,6 +49,10 @@
<MethodInvoker generator="{ExternalApiCalls}" method="handleBroadcastStartedEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{BroadcastStoppedEvent.BROADCAST_STOPPED}" >
<MethodInvoker generator="{ExternalApiCalls}" method="handleBroadcastStoppedEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{AmIPresenterQueryEvent.AM_I_PRESENTER_QUERY}" >
<MethodInvoker generator="{ExternalApiCalls}" method="handleAmIPresenterQueryEvent" arguments="{event}"/>
</EventHandlers>