Netstream onStatus and onMetadata problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eliana
    New Member
    • Jan 2008
    • 2

    Netstream onStatus and onMetadata problem

    Hi
    i'm writing a simple player to stream a flv file; video streams fine but the netstream onstatus and the nestream onmetadata are not invoked. Any help?
    Here is my code:

    var nc:NetConnectio n = new NetConnection;
    var ns:NetStream;
    var bufferLength:Nu mber = 3;
    var fileToPlay:Stri ng;

    initCon();

    function initCon(){
    nc.connect("... .server url...");
    fileToPlay = "...filename... ";
    }

    function initStream(){
    ns = new NetStream(nc);
    ns.setBufferTim e(bufferLength) ;
    objPlayer.attac hVideo(ns);
    playFile();
    }

    function playFile(){
    ns.play(fileToP lay);
    }

    nc.onStatus = function(info:O bject){
    trace("LEVEL: " + info.level + " CODE: " + info.code);

    if (info.code == "NetConnection. Connect.Success "){
    initStream();
    }
    }

    ns.onStatus = function(infoOb ject:Object) {
    trace("ns.onSta tus called: ("+getTimer( )+" ms)");
    }

    ns.onMetaData = function(info:O bject) {
    trace("ON METADATA")
    }

    thanks
Working...