Hi all,
I’m using netStream to stream dynamically loaded flv’s into a video gallery. I’ve created a “buffering” animation called “bufferCounter” that loops while the stream is buffering. However, it keeps reappearing at odd times in front of the movie.
I’m assuming it’s doing this because the buffer is no longer at 100%, but I can’t seem to work around it.
Here is my code for reference:
// Create a NetConnection object
var netConn:NetConnection = new NetConnection();
// Create a local streaming connection
netConn.connect(null);
// Create a NetStream object and define an onStatus() function
var netStream:NetStream = new NetStream(netConn);
// Attach the NetStream video feed to the Video object
portVid.attachVideo(netStream);
// Set the buffer time
netStream.setBufferTime(10);
// Begin playing the FLV file
var buffer_interval:Number = setInterval(checkBufferTime, 100, netStream);
function checkBufferTime(netStream:NetStream):Void {
var buffer:Number = Math.round(netStream.bufferLength/netStream.bufferTime * 100);
_root.bufferCounter._visible = true;
if (buffer >= 100) {
clearInterval(buffer_interval);
_root.bufferCounter.visible = false;
}
}
Thanks in advance!