Hi all 

i want to publish microphone audio to the server but failed. stream 
always show "live" on fms2_console, and no flv is published on server.
this is my client-script:

[code]

import flash.net.*;
import flash.events.*;
stop();

NetConnection.defaultObjectEncoding = ObjectEncoding.AMF0;
var nc:NetConnection = new NetConnection();
var ns:NetStream;
function ncHandler(eve:NetStatusEvent):void
{
        trace(eve.info.code);
        if(eve.info.code == "NetConnection.Connect.Success")
        {
                ns = new NetStream(nc);
                ns.addEventListener(NetStatusEvent.NET_STATUS, 
nsHandler);
                ns.attachAudio(Microphone.getMicrophone());
                ns.publish("blackcamera", "record");
        }
}

function nsHandler(eve:NetStatusEvent):void
{
        trace(eve.info.code)
}


nc.addEventListener(NetStatusEvent.NET_STATUS, ncHandler);
nc.connect("rtmp://localhost/myApplication");

[/code]

then, i create a folder called "myApplication" on server root but not 
create main.asc(i don't think it's necessary).

i run the client and trace "NetConnection.Connect.Success
" and "NetStream.Publish.Start". the server works well but the 
stream' type always "live", and the bandwidth shows nothing. 

thanks

Reply via email to