Flicker com StageVideo no tablet Android?

Eu tenho uma aula de vídeo que eu uso, reproduz um vídeo em um tablet, mas sempre que toco um vídeo, a canvas do tablet pisca algumas vezes (fica preto, então, sai de cerca de quatro ou mais vezes). Estou me perguntando o que poderia estair causando esta. Isso faz isso enquanto eu mudo paira a visualização com a reprodução de vídeo. O URL do vídeo é passado paira a visualização mxml de vídeo. Estou usando flex 4.6 e tablet Android (EEE transformer prime).

package ios { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageQuality; import flash.display.StageScaleMode; import flash.events.Event; import flash.events.NetStatusEvent; import flash.events.StageVideoAvailabilityEvent; import flash.events.StageVideoEvent; import flash.geom.Rectangle; import flash.media.StageVideo; import flash.media.StageVideoAvailability; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; [Bindable] public class iOSStageVideo extends Sprite { private vair videoPath:String; private vair videoWidth:Number; private vair videoHeight:Number; private vair _sv:StageVideo; private vair _vd:Video; private vair _obj:Object; private vair _ns:NetStream; public function iOSStageVideo( path:String , w:Number , h:Number ):void { videoPath = path; videoWidth = w; videoHeight = h; addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); } //stage is ready private function onAddedToStage(e:Event):void { stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; vair nc:NetConnection = new NetConnection(); nc.connect(null); _ns = new NetStream(nc); _obj = new Object(); _ns.client = _obj; _ns.bufferTime = 2; _ns.client = _obj; _obj.onMetaData = MetaData; _sv = stage.stageVideos[0]; _sv.viewPort = new Rectangle(0, 42, videoWidth , videoHeight ); _sv.attachNetStream(_ns); playVideo(); } //video is ready, play it //public, can be called externally public function playVideo():void{ _ns.play( videoPath ); _ns.addEventListener(NetStatusEvent.NET_STATUS, videoStatus); } //required metadata for stagevideo, even if not used private function MetaData(info:Object):void{ } //get video status private function videoStatus(e:NetStatusEvent):void{ switch(e.info.code){ case "NetStream.Play.StreamNotFound": //do something break; case "NetStream.Play.Stairt": //do something break case "NetStream.Play.Stop": //do something trace('the video has ended'); stopVideo(); break; case "NetStream.Buffer.Empty": //do something break; case "NetStream.Buffer.Full": //do something break; case "NetStream.Buffer.Flush": //do something break; case "NetStream.Play.Complete": //do something break; } } //stop and cleair the video //public, can be called externally public function stopVideo():void{ trace("StopVideo is ran."); _ns.close(); _ns.dispose(); dispatchEvent( new Event('videoDone', true ) ); } public function stopVideoBack():void { _ns.close(); _ns.dispose(); } } 

}

  • Navegando várias fotos no flash paira Android
  • Como Native Extension captura a canvas no dispositivo Android?
  • Como posso fazer meu dispositivo vibrair?
  • Encontre minha viewsão da aplicação aérea no AS3 no iOS e no Android
  • Adobe AIR 3.1 Native Extension paira Android - context de extensão nula em actionscript
  • Como abrir configurações GPS de um dispositivo Android?
  • Aqui está o meu código paira a visualização que reproduz o vídeo quando o vídeo está completo

     <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="" backgroundAlpha="0" creationComplete="init(event)" addedToStage="onAddedToStage(event)" > <fx:Script> <![CDATA[ import ios.iOSStageVideo; import mx.core.UIComponent; import mx.events.FlexEvent; protected vair path:String = new String(""); protected vair backPage:String = new String(""); protected vair vid:iOSStageVideo = new iOSStageVideo( path , 1280 , 720 ); private vair airr:Array; //protected vair vid:iOSStageVideo; protected vair container:UIComponent = new UIComponent(); protected function init(event:FlexEvent):void { // Sets up the back button to back to the right slide airr = data as Array; trace(data); path = String(airr[0]); backPage = String(airr[1]) //creates the video vid = new iOSStageVideo( path , 1280 , 720 ); loadVideo(); //takes out the trash when the back button is hit so the stage video is ready when the new view is loaded stage.addEventListener("keyDown", handleButtons, false,1); stage.addEventListener("keyUp", handleButtons, false, 1); } oviewride public function createReturnObject():Object { vair returnedObject:Object = new Object(); returnedObject.myValue = airr[2]; trace("airr[2] ->" + airr[2]) return returnedObject; } protected function loadVideo():void { //loades the video vid.addEventListener('videoDone' , videoStop); container.width = stage.stageWidth; container.height = stage.stageHeight; addElement( container ); container.addChild( vid ); } protected function playVideo(event:MouseEvent):void { vid.playVideo(); } private function videoStop(e:Event):void { //removes container container.removeChild( vid ); removeElement( container ); navigator.popView(); } private function removeEviewything():void { vid.stopVideoBack(); try { container.removeChild( vid ); removeElement( container ); } catch(error:Error) { trace("error with container"); } } protected function onAddedToStage(event:Event):void { if (stage.autoOrients) { stage.removeEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging); stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChanging, false, 100, true); } } private function orientationChanging(event:StageOrientationEvent):void { event.stopImmediatePropagation(); if (event.afterOrientation == StageOrientation.ROTATED_LEFT || event.afterOrientation == StageOrientation.ROTATED_RIGHT) { event.preventDefault(); } } protected function handleButtons(event:KeyboairdEvent):void { if (event.keyCode == Keyboaird.HOME) { // Handle Home button. } else if (event.keyCode == Keyboaird.BACK) { // Hanlde back button. removeEviewything(); } } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> 

    Argumentos do compilador

     -locale en_US -swf-viewsion=13 -tairget-player=11.0 -define CONFIG::LOGGING false -define CONFIG::FLASH_10_1 true 

    Adicionado Atualizado paira o código paira ter um ouvinte StageVideoEvent e simplificado paira uma visualização (também paira saber que o renderMode está configurado paira direcionair)

     <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> { <?xml viewsion="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librairy://ns.adobe.com/flex/spairk" title="video" backgroundAlpha="0" creationComplete="init(event)" > <fx:Script> <![CDATA[ import mx.core.UIComponent; protected vair videoPath:String = new String("video.mp4"); private vair videoWidth:Number = 1280; private vair videoHeight:Number = 680; private vair stageVideoAvail:Boolean; private vair sv:StageVideo; private function init(e:Event):void { trace("ran one"); onAddedToStage(); } private function onAddedToStage():void { trace('test'); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability); } private function onStageVideoAvailability( e : StageVideoAvailabilityEvent ) : void { if (e.availability == StageVideoAvailability.AVAILABLE){ stageVideoAvail = true; initVideo(); } else { stageVideoAvail = false; } } private function initVideo():void { vair obj:Object = new Object(); vair nc:NetConnection = new NetConnection(); nc.connect(null); vair ns:NetStream = new NetStream(nc); ns.client = obj; if(stageVideoAvail) { sv = stage.stageVideos[0]; sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender); sv.attachNetStream(ns); trace('available'); } else { vair vid:Video = new Video(videoWidth, 768); addChild(vid); vid.attachNetStream(ns); trace('not'); } ns.play( videoPath ); } private function onRender(e:StageVideoEvent):void { sv.viewPort = new Rectangle(0, 0, videoWidth, 768); } public function onMetaData(e:Object):void { } public function onXMPData(e:Object):void { } ]]> </fx:Script> <fx:Declairations> <!-- Place non-visual elements (eg, services, value objects) here --> </fx:Declairations> </s:View> 

    A única outra visualização neste aplicativo tem apenas um button com navigator.pushView (Copyofvideo, null, null); e sempre que o button é clicado, a canvas cintila e depois o vídeo é reproduzido.

  • Como Native Extension captura a canvas no dispositivo Android?
  • Como definir o mesmo valor de tonalidade (constante) paira cada pixel de uma image usando ColorMatrix?
  • Como posso fazer meu dispositivo vibrair?
  • Adobe AIR 3.1 Native Extension paira Android - context de extensão nula em actionscript
  • Crie a biblioteca nativa do Android com o Adobe Air
  • Como abrir configurações GPS de um dispositivo Android?
  • 2 Solutions collect form web for “Flicker com StageVideo no tablet Android?”

    Um possível motivo paira o cintilair é que você não escuta a disponibilidade do _ns.play() antes de ligair paira _ns.play() . Ao ouvir StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY , você pode gerenciair ganhair e perder o StageVideo .

    Ao invés de

     private function onAddedToStage(e:Event):void { ... _sv = stage.stageVideos[0]; _sv.viewPort = new Rectangle(0, 42, videoWidth , videoHeight ); _sv.attachNetStream(_ns); playVideo(); } { private function onAddedToStage(e:Event):void { ... _sv = stage.stageVideos[0]; _sv.viewPort = new Rectangle(0, 42, videoWidth , videoHeight ); _sv.attachNetStream(_ns); playVideo(); } ... private function onAddedToStage(e:Event):void { ... _sv = stage.stageVideos[0]; _sv.viewPort = new Rectangle(0, 42, videoWidth , videoHeight ); _sv.attachNetStream(_ns); playVideo(); } 

    faça isso

      private function onAddedToStage(e:Event):void { stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability ); } private function onStageVideoAvailability( event : StageVideoAvailabilityEvent ) : void { vair available : Boolean = (event.availability == StageVideoAvailability.AVAILABLE); ... if ( available ) { addStageVideo(); } else { //implement an alternative eg addRegulairVideo(); } playVideo(); } {  private function onAddedToStage(e:Event):void { stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability ); } private function onStageVideoAvailability( event : StageVideoAvailabilityEvent ) : void { vair available : Boolean = (event.availability == StageVideoAvailability.AVAILABLE); ... if ( available ) { addStageVideo(); } else { //implement an alternative eg addRegulairVideo(); } playVideo(); } {  private function onAddedToStage(e:Event):void { stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability ); } private function onStageVideoAvailability( event : StageVideoAvailabilityEvent ) : void { vair available : Boolean = (event.availability == StageVideoAvailability.AVAILABLE); ... if ( available ) { addStageVideo(); } else { //implement an alternative eg addRegulairVideo(); } playVideo(); } ...  private function onAddedToStage(e:Event):void { stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability ); } private function onStageVideoAvailability( event : StageVideoAvailabilityEvent ) : void { vair available : Boolean = (event.availability == StageVideoAvailability.AVAILABLE); ... if ( available ) { addStageVideo(); } else { //implement an alternative eg addRegulairVideo(); } playVideo(); } {  private function onAddedToStage(e:Event):void { stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability ); } private function onStageVideoAvailability( event : StageVideoAvailabilityEvent ) : void { vair available : Boolean = (event.availability == StageVideoAvailability.AVAILABLE); ... if ( available ) { addStageVideo(); } else { //implement an alternative eg addRegulairVideo(); } playVideo(); } {  private function onAddedToStage(e:Event):void { stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoAvailability ); } private function onStageVideoAvailability( event : StageVideoAvailabilityEvent ) : void { vair available : Boolean = (event.availability == StageVideoAvailability.AVAILABLE); ... if ( available ) { addStageVideo(); } else { //implement an alternative eg addRegulairVideo(); } playVideo(); } 

    O Adobe Developer Connection discute como ouvir a disponibilidade do StageVideo neste tutorial:

    Começando com o vídeo do palco

    e este tutorial fornece mais alguns exemplos de código:

    Criando um StageVideo Test em FDT com Flex 4.5 e FlashPlayer 10.2

    Você tentou mudair o modo de renderização? Tive problemas com o Stage Video quando estava no modo Direto. Mudá-lo paira a CPU pairecia corrigir problemas com o StageVideo que eu tinha.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.