views:

136

answers:

0

I'm currently building a custom Flash player that will play streaming video from an FMS. Everything is working 100%. However, I would like to optimize the way the player seeks from one part of the video to another. Currently, anytime the seek method is used to progress to another part of the video the buffer is restarted from the time progressed to and any prior buffering seems to be discarded. This happens even if the part of the video progressed to is already buffered according to the NetStream. I would like for the player to take advantage of any prior buffering by playing the video locally if that part has already been buffered/downloaded.

If you view any of the videos on Youtube or most of the other major video sites this seems to be how their player works. Are they doing something custom by switching between streaming and progressive downloading? Or is there an FMS config or NetStream property I can change that will accomplish this for me?

Here is a snippet of code that shows how my NetStream is created...

ns = new NetStream(nc);
ns.checkPolicyFile = true;
ns.client = this;
ns.bufferTime = .05;
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);

All seeking is currently done using ns.seek([time to seek to]);

Thanks.