Perhaps a more accurate and less catchy title would be: Why does my live stream gain delay when the browser window is hidden, and how do I prevent/undo it?
I'm sending a live stream (packaged as an FLV file) to a flash player via a NetStream, and when the browser window is hidden/minimized, a delay begins to accumulate such that the player is always some number of seconds behind what's happening live. I wish to prevent or otherwise get rid of this delay.
My issue is very similar to this one, with the exception that the "catch-up feature" isn't taking place in my stream.
What's confusing/frustrating about this is that there should be no room for all those seconds of buffered video. I believe I set all the NetStream variables appropriately:
stream.backBufferTime = 0;
stream.bufferTime = 0;
stream.bufferTimeMax = 0;
stream.maxPauseBufferTime = 0;
stream.inBufferSeek = false;
And yet still, all that video is getting buffered somewhere. It would be helpful to know where this buffer is and if there's a way to nuke it (or even to ask it politely to clear itself and stream from the most recent frame).
Currently, I try to work around the problem by doing a NetStream.seek(10000000000)
call every five seconds--seeking way into the future, so that the stream just grabs the farthest forward keyframe and starts playing from there. This works well on Firefox and IE, but has no effect and does not neutralize the delay in Chrome. I have tried doing logarithmically increasing seek()
s from the current position, keeping the value within the range of what's buffered, but this creates unacceptable 3-second hiccups in the playback.
Any information or suggested solutions would be appreciated. :)