I have a Flash client that live-streams video over RTMP using NetStream. For some reason, Flash is ignoring the bufferTimeMax value, and under some circumstances bufferLength can grow to very large values. I cannot allow the buffer to grow to more than one second in size, so when it gets too large I need to flush the buffer. Right now the only method I have that works requires destroying the NetStream and NetConnection objects and reconnecting. The problem with this approach is that the app goes black while this happens, which is not acceptable.
I have tried the following approaches to flushing the buffer:
- Set bufferTime to zero, and then set it back to the desired value
- Seek to one second in the future
- close() the NetStream and then play() it again
- Create a new NetStream object while keeping the existing NetConnection
All of these methods fail for various reasons, usually by preventing video from playing at all.