I had a problem with with the FLVPlayback component recently. Real weird. When clicking on a button, it would create a new FLVPlayback component and play the video. The video will load and play fine the first time but on the network it would hang the second time for about 30 seconds then load and play. The third, fourth, fifth times, loaded fine again. After digging through the problem, stopping and closing the FLVPlayback, setting all variables to null, calling the System.gc()... still the problem existed.
Finally took some time to really go through the API docs a bit closer and noticed there was a way to get a hold of the VideoPlayer within. So, got the problem fixed by stopping and closing the video player, then stop and nullify the FLVPlayback, and finally collect the garbage.
var vidPlayer:VideoPlayer = myFLVPlayback.getVideoPlayer(myFLVPlayback.activeVideoPlayerIndex);
vidPlayer.stop();
vidPlayer.close();
myFLVPlayback.stop();
myFLVPlayback = null;
System.gc();
vidPlayer.stop();
vidPlayer.close();
myFLVPlayback.stop();
myFLVPlayback = null;
System.gc();
2 comments:
Thanks a bunch. I had exactly the same problem and it bugged me for a few hours and was never able to track down what the problem was. This fixed it right up.
Okay.. I spent seriously too much time searching on google all the flash forums looking for this information.
Well done! Thanks for solving my actionscripting issues :-)
Post a Comment