Flash Player: Any remedy for the stale video image data problem (in a reused NetStream object)?
Posted
by amn
on Stack Overflow
See other posts from Stack Overflow
or by amn
Published on 2010-05-05T14:53:35Z
Indexed on
2010/05/05
14:58 UTC
Read the original article
Hit count: 216
flashplayer
Has anyone experienced stale stills of a previous playback for a reused NetStream object? If so, what are the workarounds for this, except re-creating the object (which eats performance and time)?
It is hard to reuse NetStream objects because of a (in my opinion) fundamental issue with NetStream objects - when you 'close' a playing stream and at a later point issue a 'play' call on it again with a different name, the stream appears to still contain a stale image lingering from previous playback, and this is of course displayed in the Video object for a moment - the moment I assume it takes for new stream data to become available from server.
Because of this behavior, to improve my users' visual experience, I simply discard a NetStream object after a playback session, and assign a new NetStream object to the same variable, set it up, and play something else. It appears to work - no stale image - but what bugs me is that it's a work around and costs performance (construction and setting up the object again - event listeners and 'client' delegates and more memory usage - NetStream objects are not garbage collected immediately, it takes some time).
It would be really nice to REALLY be able to reuse a stream.
I am thinking of something akin to Video.clear method, but for the NetStream class.
Am I missing something?
© Stack Overflow or respective owner