Skip to main content
Participant
December 12, 2006
Question

Buffer Flush

  • December 12, 2006
  • 1 reply
  • 223 views
So, I'm trying to play streaming video from Dlash Media Server.
nc = new NetConnection();
nc.connect('rtmp://mysite/myapp');
ns = new NetStream(nc);
var startBufferLength = 2;
ns.setBufferTime(startBufferLength);
// create and set sound object
var snd = this.createEmptyMovieClip("snd5", this.getNextHighestDepth());
snd.attachAudio(ns);
audio = new Sound(snd);
audio.setVolume(80);
// attach videodisplay
videoDisplay.attachVideo(ns);
videoDisplay.smoothing = true;
ns.play("video",0);

It's starts playing but near the end of the clip when in buffer is less than 2 seconds but data don't streams any more, buffer flushes and the data that is in the buffer didn't display. Help me please what to do to display this last seconds.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Participating Frequently
    December 12, 2006
    I tried the code and it seemed to work with a video I have on FMS server hosted at Influxis.

    You might want to use the normal template and listen for the onStatus messages coming from the NetStream ns object and see if you are getting a status message at the time you think you are losing the data.

    stream_ns.onStatus = function(infoObject:Object) {
    trace("NetStream.onStatus called: ("+getTimer()+" ms)");
    for (var prop in infoObject) {
    trace("\t"+prop+":\t"+infoObject[prop]);
    }
    trace("");
    };

    Also you might want to try other video sources that you recorded or from another source.