Skip navigation
Poducts
Currently Being Moderated

NetStream on flex mobile not working

May 11, 2013 4:00 AM

Tags: #flex-mobile #live_streaming #flash_media_server

Hi

I'm trying to make a flex mobile application that sends the live video of my android phone's camera to flash media server on my localhost.When i check on the server side , the connection is established with the client side and but the stream is not there.Here si the code that i used :

<fx:Script>

<![CDATA[

import flash.media.Camera;

import flash.media.Video;

import flash.net.NetConnection;

 

protected var nc:NetConnection;

protected var peerID:String ;

protected var ns:NetStream ;

protected var  camera:Camera;

protected var video:Video  ;

private function connection(event:MouseEvent):void{

nc=new NetConnection();

nc.connect("rtmp://localhost/vod");

nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR,asyncHandler);

nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

nc.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);

  function asyncHandler(Event:AsyncErrorEvent):void

{

trace("Error Handled");

}

function onBWDoneHandler( eventObj:Object ):void

{

trace("Error Handled");

}

function netStatusHandler(event:NetStatusEvent):void{

 

switch (event.info.code){

 

case "NetConnection.Connect.Success":

trace("connectino succeded") ;

ns=new NetStream(nc,peerID);

camera= Camera.getCamera();

ns.attachCamera(camera);

ns.publish("test","live");

case "NetConnection.Connect.Failed":

 

break;

}

}

function onSecurityError(event:SecurityErrorEvent):void{}

}

 

]]>

</fx:Script>

Any one can help me please ? any advice or pointers will be appreciated.Thanks in advance.

 
Replies
  • Currently Being Moderated
    May 12, 2013 2:33 PM   in reply to Poducts

    Because you have the vod ( video on demand ) in you nc.connect("rtmp://localhost/vod"); connect call makes me think you are using the wrong FMS / AMS  version.

    You need the interactive server to publish video.

    You may be running Flash Media Streaming Server and not Flash Media Interactive Server.

    Or the new AMS versions.

    Adobe Media Server 5 Standard

    You should use

    Adobe Media Server 5 Professional.

     

    HTH

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points