-
FLVplayback...Buffering?
hi flashers,
Ok i swear i've searched high and low, and I am so struggling. PLEASE HELP!!!!! I am using the FLVPlayback component and am using video in a presentation with no controllers so i need to set up a dynamic buffer..it's a short video about 1min. I would like it to buffer smartly so that it barely stutters and that while the buffer is emptying it gets full at the same time? Possible!?
I also want it so that when it's done playing it'll jump to a frame. I used the FLV complete command and it worked until I had to connect using netstream to figure out the buffering part.
Anyhow, i have this code but the video aint playing, i get audio but no video. Any ideas?!?!!?!?!?!!~?
stop();
this.createTextField("buffer_txt", this.getNextHighestDepth(), 10, 10, 300, 22);
buffer_txt.html = true;
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
clip.attachVideo(stream_ns);
stream_ns.setBufferTime(3);
stream_ns.play("http://urltoflv.com/flv.flv");
var buffer_interval:Number = setInterval(checkBufferTime, 100, stream_ns);
function checkBufferTime(my_ns:NetStream):Void {
var bufferPct:Number = Math.min(Math.round(my_ns.bufferLength/my_ns.bufferTime * 100), 100);
var output_str:String = "<textformat tabStops='[100,200]'>";
output_str += "Length: "+my_ns.bufferLength+"\t"+"Time: "+my_ns.bufferTime+"\t"+"Buffer:"+bufferPct+"% ";
output_str += "</textformat>";
buffer_txt.htmlText = output_str;
}
PLEASE HELP!!!!!
You have to think in Flash
-
Senior Member
I also want it so that when it's done playing it'll jump to a frame. I used the FLV complete command and it worked until I had to connect using netstream to figure out the buffering part.
I'm not sure about the buffering part, but I do know about the command to tell it to jump to a frame when finished. Using the netStream method it would look like this:
Code:
stream_ns.onStatus = function (oInfo:Object) {
if(oInfo.code == "NetSteam.Play.Stop") {
gotoAndPlay(frame number here);
}
};
I just put this on its own layer on the same frame as the code used to set up the movie/connection.
Sorry I can't help you with the buffering. Hope this helps you out.
~burn
This is your brain. This is your brain on script.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|