PDA

View Full Version : netstream buffer, video streaming


darth
04-20-2005, 08:53 AM
I want to make a "buffering" to my flash video playback, but -

NetStream.bufferLength is starting to decrease towards the end of video file, also I cannot seem to get it to display numbers from 1 to 100 when my bufferTime is set for example, 17 seconds...
Help!


var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
my_video.attachVideo(netStream);
netStream.setBufferTime(17);
netStream.play("http://server.com/videofile.flv");
var a:Number = 0;
onEnterFrame = checkBuffer;
function checkBuffer():Void {
a = Math.floor(netStream.bufferTime/netStream.bufferLength*100);
if (a<97) {
status_txt.text = "buffering... "+a+"%";
} else {
status_txt.text = "";
}
}