How to buffer stream when the video is paused with flash
I need a feature of allowing buffering the video when it's paused, which I cannot find how to do it directly...
I notice that, when I pause the video, the event "NetStream.Buffer.Flush" is triggered. And according to the language reference: "Data has finished streaming开发者_如何转开发, and the remaining buffer will be emptied.", I have to re-buffer it, right? However, also according to the reference, it shouldn't stop buffering:
Starting with Flash Player 9.0.115.0, Flash Player no longer clears the buffer when NetStream.pause() is called. This behavior is called "smart pause". Before Flash Player 9.0.115.0, Flash Player waited for the buffer to fill up before resuming playback, which often caused a delay.
I'm using Flash Professional to do the debugging, and the traced version number is: MAC 10,0,22,91; and for the streaming server, I use red5. And if you're interested with my code, here it is: http://pastebin.com/kwTfiEH9
I'm now totally confused. Any push is appreciated very much!
here's an example on wondefl.net based on your code
精彩评论