1

I want to stream live video from my android device using flash builder 4.6 mobile project...But couldn't achieve..help plz..

Here is my code:

  <?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>

I couldn't stream video.i can't even see the video on my device itself..only blank page is open when i run this..

And I tried to find the error for that i replace

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

Now I got the error at the line

  ns=new NetStream(nc);

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

What will be the solution and how to achieve in streaming video in this case?

Thanks,

4

1 回答 1

0

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

于 2013-07-19T18:09:09.770 回答