How to play video on an Android tablet with a mobile mobile phone, without it?

I am trying to create an application that will play video on an Android tablet. The tablet is a transformer generation running Android version 4.0.3. I am using Flash Builder 4.6 with Flex 4.6.0. Every time I upload a video to a tablet, it is very intermittent and nervous. If I try to use any video that is not flv, the video is always sent to the background for all other content and no longer remains with the container in which it is placed. I created sliding containers that can be moved left or right, and the video moves with them, and it works with flv files, but not with any other file formats (for example, H.264 and f4v), it remains at stage x = 0 and y = 0 is not a group x = 0 and y = 0 and does not move. When a video is ever played, the screen always flickers, and then the video plays. Flv files are always the worst for playback. Sorry, I'm not trying to run. I'm just trying to get the imported information.
Here is the code for the video playgroup I created.

<?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" width="960" height="533" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <![CDATA[ import mx.events.EffectEvent; [Bindable] public var imgSource:String = new String(); [Bindable] public var isThereAVideo:Boolean = new Boolean() public var movieSource:String = new String(); [Bindable] protected var bytes:uint = new uint(); [Bindable] protected var bytesTotel:uint = new uint(); protected function playMovieClick(event:MouseEvent):void { // TODO Auto-generated method stub trace ("you clicked") var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); ns.client={ onMetaData:function(obj:Object):void{} } ns.play(movieSource); var myVideo:Video = new Video(); myVideo.width = 960; myVideo.height = 533; myVideo.attachNetStream(ns); uic.addChild(myVideo); ns.addEventListener(NetStatusEvent.NET_STATUS, netstatusHandler); quickfade.target = uic; quickfade.alphaFrom = 0; quickfade.alphaTo = 1; quickfade.play(); ns.soundTransform.volume = 0; } public function netstatusHandler(evt:NetStatusEvent):void { if (evt.info.code == "NetStream.Play.Stop") { quickfade.target = uic; quickfade.alphaTo = 0; quickfade.alphaFrom = 1; quickfade.play(); quickfade.addEventListener(EffectEvent.EFFECT_END, fadeEffectEnd); } } private function fadeEffectEnd(event:EffectEvent):void { trace("effect ending"); uic.visible = false; trace("....effect ending"); quickfade.removeEventListener(EffectEvent.EFFECT_END, fadeEffectEnd); } public function asyncErrorHandler(event:AsyncErrorEvent):void { trace(event.text); } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (eg, services, value objects) here --> <s:Fade id="quickfade" duration="1500" /> </fx:Declarations> <s:Image width="100%" height="100%" source="{imgSource}"/> <s:Image width="75" height="75" bottom="5" right="5" source="img/videoIcon.png" click="playMovieClick(event)" visible="{isThereAVideo}" /> <mx:UIComponent x="0" y="0" id="uic" width="960" height="533" alpha="0" /> <s:Label x="10" y="508" text="v0.1"/> 

So, here are my questions questions
Is there a better way to play this video to make it smoother? I heard about stage.stagevideo, but if I track stage.stagevideo.length, do I always get 0?

Why the video will lose the container. Could this have anything to do with container layout using scene width?

Is there a way to buffer video?

+4
source share
1 answer

The best way to play videos is to use a native player instead of a flexible video player. However, you need to play inside Flex, then you can try Stage Video ( http://www.adobe.com/devnet/flashplayer/articles/stage_video.html ) because flex on the mobile device skips the video frame.

+1
source

Source: https://habr.com/ru/post/1393250/


All Articles