diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/MainViewMediator.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/MainViewMediator.as index 00efbd1c6a..73bdc7c450 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/MainViewMediator.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/MainViewMediator.as @@ -8,11 +8,11 @@ package org.bigbluebutton.air.main.views { override public function initialize():void { - + trace("************ MainViewMediator:: INIT **************"); } override public function destroy():void { - + trace("************ MainViewMediator:: destroy **************"); } } } diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/TopToolbarMediator.as b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/TopToolbarMediator.as index e58b27db6a..ea909843d0 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/main/views/TopToolbarMediator.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/main/views/TopToolbarMediator.as @@ -94,6 +94,7 @@ package org.bigbluebutton.air.main.views { } else if (uiSession && uiSession.currentPage.indexOf("Settings") > 0) { uiSession.popPage(); } else { + trace("***** TopToolbarMediator:: Switching to MAIN PAGE"); uiSession.pushPage(PageEnum.MAIN); } } diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareView.as b/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareView.as index 1856f7262c..a141adf229 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareView.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareView.as @@ -1,6 +1,7 @@ package org.bigbluebutton.air.screenshare.views { import flash.events.AsyncErrorEvent; + import flash.events.Event; import flash.events.NetStatusEvent; import flash.events.StageVideoAvailabilityEvent; import flash.media.StageVideoAvailability; @@ -17,33 +18,42 @@ package org.bigbluebutton.air.screenshare.views private var ns:NetStream; private var _video:Video; - - private var connection:NetConnection; - - private var userId:String; - - private var userName:String; - - private var streamName:String; - + private var originalVideoWidth:Number; private var originalVideoHeight:Number; public function ScreenshareView():void { + // Constructor for SimpleStageVideo class + // Make sure the app is visible and stage available + trace("************ ScreenshareView: constructor"); + addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); _video = new Video(); addChild(_video); } - private function onStageVideoState(event:StageVideoAvailabilityEvent):void + private function onAddedToStage(event:Event):void + { + // Video Events + // the StageVideoEvent.STAGE_VIDEO_STATE informs you whether + // StageVideo is available + + trace("************ ScreenshareView: STAGE VIDEO onAddedToStage "); + stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState); + } + + private function onStageVideoState(event:StageVideoAvailabilityEvent):void { var available:Boolean = (event.availability == StageVideoAvailability.AVAILABLE); - trace("STAGE VIDEO available=" + available); + trace("************ ScreenshareView: STAGE VIDEO available=" + available); } public function viewStream(conn:NetConnection, streamId:String, width:int, height:int):void { - trace("TODO: Need to implement viewing of screenshare stream"); -// stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState); + trace("************ ScreenshareView: viewing of screenshare streamId=" + streamId + " w=" + width + " h=" + height); + if (stage == null) { + trace("************ ScreenshareView: STAGE IS NULL!!!!!!!!"); + } + ns = new NetStream(conn); ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus); ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError); @@ -67,7 +77,7 @@ package org.bigbluebutton.air.screenshare.views private function onNetStatus(e:NetStatusEvent):void { switch (e.info.code) { case "NetStream.Publish.Start": - trace("NetStream.Publish.Start for broadcast stream " + streamName); +// trace("NetStream.Publish.Start for broadcast stream " + streamName); break; case "NetStream.Play.UnpublishNotify": // close(); @@ -92,5 +102,15 @@ package org.bigbluebutton.air.screenshare.views public function onMetaData(info:Object):void { trace("ScreenshareView::ScreenshareView width={0} height={1}", [info.width, info.height]); } + + public function dispose():void { + trace("************ ScreenshareView: dispose *********************"); + if (stage != null) { + trace("************ ScreenshareView::dispose - remove listener ****************"); + stage.removeEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState); + } + removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage) + } + } } \ No newline at end of file diff --git a/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareViewMediator.as b/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareViewMediator.as index 0464dd2d57..69f2c55b78 100755 --- a/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareViewMediator.as +++ b/clients/flash/air-client/src/org/bigbluebutton/air/screenshare/views/ScreenshareViewMediator.as @@ -18,6 +18,7 @@ package org.bigbluebutton.air.screenshare.views public var model:IScreenshareModel; override public function initialize():void { + trace("************ ScreenshareViewMediator:: INIT **************"); model.screenshareStreamStartedSignal.add(viewStream); model.screenshareStreamStoppedSignal.add(streamStopped); } @@ -29,5 +30,13 @@ package org.bigbluebutton.air.screenshare.views public function streamStopped(session:String, reason:String):void { view.streamStopped(session, reason); } + + override public function destroy():void { + trace("************ ScreenshareViewMediator:: destroy **************"); + model.screenshareStreamStartedSignal.remove(viewStream); + model.screenshareStreamStoppedSignal.remove(streamStopped); + view.dispose(); + view = null; + } } } \ No newline at end of file