如何使用Adobe AIR的移动与出他们是断断续续打在Android平板电脑的视频吗? [英] How to play videos on a android tablet in with adobe air mobile with out them being choppy?

查看:138
本文介绍了如何使用Adobe AIR的移动与出他们是断断续续打在Android平板电脑的视频吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个应用程序,将播放视频上的Andr​​oid平板电脑。在平板电脑上运行的Andr​​oid版本4.0.3变压器素数。我使用Flash Builder 4.6使用Flex 4.6.0。每次我添加视频到平板电脑,这是非常不连贯和跳跃。如果我尝试使用没有flv的则视频总是发送到后面的所有其他内容的背景任何视频和不再与它被放置到容器中停留。我创建了一个滑动的容器,可以向左或向右移动和视频移动与他们和它的作品与FLV文件,但不与任何其他文件格式(如H.264和F4V),它停留在舞台X = 0和y = 0不是基X = 0和y = 0,不动。在以往的视频播放总有一个画面闪烁,然后播放视频。 FLV文件总是最糟糕的回放。对不起,我不是要絮絮叨叨我只是试图让导入的信息
这里是$ C $下,我创建的视频播放组。

I am trying to build a app that will play videos on a Android tablet. The tablet is a transformer prime running a Android version 4.0.3. I am using flash Builder 4.6 with Flex 4.6.0. Every time i add a video to the tablet, it is very choppy and jumpy. If i try and use any video that is not flv then the video is always sent to the background behind all the other content and no longer stays with the container that it is placed into. I created a 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 (such as H.264 and f4v) it stays at the stage x = 0 and y = 0 not the group x = 0 and y = 0 and does not move. When ever a video is played there is always a screen flickers and then the video plays. Flv files are always the worst for playing back. Sorry I'm not trying to ramble I'm just trying to get the imported information
Here is the code for the video playing group that 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 (e.g., 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"/>

因此​​,这里是我的问题问题
有没有更好的方式来播放该视频,使其更顺畅?我听说过stage.stagevideo但如果我跟​​踪stage.stagevideo.length我总是得到0?
为什么视频输容器。难道有什么关系具有容器位置用舞台宽度设置?
有没有一种方法来缓冲视频?

So here is my question questions
Is there a better way to play this video so that it is smoother? I have heard about stage.stagevideo but if i trace stage.stagevideo.length i always get 0?
Why does the video lose the container. Could it have anything to do with having the container location set by using stage width?
Is there a way to buffer the video?

推荐答案

播放视频使用本地球员,而不是柔性的视频播放器的最佳方式。你仍然需要在Flex玩,那么你可以尝试舞台视频(的http:// www.adobe.com/devnet/flashplayer/articles/stage_video.html ),因为弯曲在移动没有跳过视频的帧。

The best way to play video to use native player instead of flex video player. Still you need to play inside the flex then you can try Stage Video (http://www.adobe.com/devnet/flashplayer/articles/stage_video.html) because flex on mobile does skip the frame of the video.

这篇关于如何使用Adobe AIR的移动与出他们是断断续续打在Android平板电脑的视频吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆