Trying to buffer on Flash Media Server


hi all, embasarred should have studied more having massive difficulty in getting videos buffer flash media server 3.5. videos on web , streaming fine need put actionscript in make them work... sounds easy. also, come across article fabio sonatti seems offer solution need. states following script.

 

function initconnection() {
   // create netconnection
   nc = new netconnection();
   // define onstatus event handler
   nc.onstatus = function(info) {
   trace("level: "+info.level+" code: "+info.code);
   // initialize stream after connection successful
   if (info.code == "netconnection.connect.success") {
      trace("--- connected to: " + this.uri);
      startstream(); //inizialize stream
      }
   };
   // try connect, changed app path
   nc.connect("rtmp://127.0.0.1/dualbuffering/demo");
}

 

function startstream() {
   //define stream , buffers parameters
    stream_name="test_stream";  //your stream
    startbufferlength=2; //keep in range 2-4+
    expandedbufferlength=15;  //arbitrarily high

 

   // create netstream
   ns = new netstream(nc);
 
   // define onstatus event handler
   ns.onstatus = function(infoobject:object) {
      if (infoobject["code"]=="netstream.buffer.full"){
      ns.setbuffertime(expandedbufferlength);
      trace("set expanded buffer");
      }
      if (infoobject["code"]=="netstream.buffer.empty"){
      ns.setbuffertime(startbufferlength);
      trace("set start buffer");
      }
   }

 

   // attach netstream video object
   // change videoobj istance name if needed
   videoobj.attachvideo(ns);
   ns.setbuffertime(startbufferlength);
   ns.play(stream_name, 0);
}
initconnection();
stop();

 

now, please appreciate know lkittle actionscript know change path "rtmp etc etc" location of video on fms, thats fine. have problem afraid. 100% sure need replace other items within code make work (as errors when test video in flash) afraid , embarassed have no idea items change. know code perfect dont know netstream , think letting me down.

 

i apologise in advance being idiot desperate these videos buffering, know codfe need talk me in dead simpl;e terms put me in right direction. can ? : many : dom  



More discussions in Adobe Media Server


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

RFID-RC522 with Arduino Pro Micro project. Error on the code?