繁体   English   中英

如何使用Flex 4.6 Mobile项目在Air android上流式传输视频?

[英]How to stream video on Air android with flex 4.6 mobile project?

我想使用Flash Builder 4.6移动项目从我的android设备流式传输实时视频...但是无法实现..help plz ..

这是我的代码:

  <?xml version="1.0" encoding="utf-8"?>
  <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
         creationComplete="windowedapplication1_creationCompleteHandler(event)"
             xmlns:mx="library://ns.adobe.com/flex/mx" width="480" height="800">
  <fx:Script>
    <![CDATA[
        import flash.filters.ColorMatrixFilter;
        import mx.events.FlexEvent;
        private var myCam:CameraUI;
        private var cam:Camera;
        private var nc:NetConnection;
        private var ns:NetStream;
        private var video:Video;
        private var meta:Object;
        private var nsClient:Object =new Object();
        protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
        {
            connect();
        }
        private function connect():void
        {
            if(nc==null)
            {
                        nc = new NetConnection();
                nc.connect("rtmp://localhost/live");
                    // get status information from the NetConnection object
                nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
                        }
        }
        private function netStatus(event:NetStatusEvent):void {
            var infoObject:Object=event.info;
            trace("nc: "+infoObject.code+" ("+infoObject.description+")");
            if (infoObject.code == "NetConnection.Connect.Success")
            {
                ns = new NetStream(nc);
                ns.publish("sample");
                ns.client = nsClient;
                video = new Video();
                video.smoothing = true;
                video.attachNetStream(ns);
                                    uic.addChild(video);
                }
        }
    ]]>
</fx:Script>
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:UIComponent id="uic" />
    </s:Application>

我无法流式播放视频。我什至无法在设备本身上观看视频。.运行此操作时,只有空白页打开。

我试图找到我替换的错误

   ns.publish("sample") with ns.play("http://flv.dudeel.com/flv/p2DAM3FX7tBrk.flv")

现在我得到了错误

  ns=new NetStream(nc);

  Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Play.StreamNotFound

在这种情况下,视频流中的解决方案是什么?如何实现?

谢谢,

也许您需要实施互联网许可?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM