Question

I'm building a flash site with video transitions between sections. When a navigation element is clicked, there's some code to check if the relevant FLV has already been loaded. If it hasn't, it gets initialized (i.e. netstream attached to video object, etc), loaded and played back; if it has, it just gets restarted and played back. So far, so good.

My question is in regard to the situation in which the video has already been loaded and is replayed because the user is revisiting a section of the site they've been to already. Whenever the video gets replayed, there's a visual flash of the final frame of the video, lasting probably about a tenth of a second, before it restarts and plays through correctly. I've tried several approaches to get rid of the "flashing", including seek(0)ing the netStream object before replaying it. Incidentally, the video object is added to the stage immediately prior to playing back a given transition, and it's removed from the stage immediately after the transition completes via a callback. Given that it's added to the stage AFTER the call to seek(0), it strikes me as particularly odd that this problem persists.

Any ideas about what might be causing my phantom final frame flashes?

EDIT: In case anyone's wondering, the site is built in AS3 and uses the Gaia flash framework, though I'm pretty sure that's not causing any of the trouble as I built a proof-of-concept without Gaia and ran into the same problems.

Was it helpful?

Solution

A couple of things to try:

  • If you are re-using the same video object, try videoObject.clear()
  • When re-playing a video, set the buffer on the NetStream to 0
  • Try to hold off on adding the NetStream to the video object until you get a NetStream.Play.Start message

If you need help on the code for this, let me know.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top