Following my previous post on “Unload Video Using CS3 FLVPlayback Component“, I have found a problem when you have closed the video stream using “getVideoPlayer()” method but didn’t unload the swf that contains the FLVPlayback Component…

Basically if you load the video using “load()” from the FLVPlayback instance then close it using “getVideoPlayer()” which will close the video stream but does not delete the flv source reference in FLVPlayback instance since FLVPlayback class wraps a VideoPlayer object. E.g- below will cause an error:

myFLVPlayback.load("video.flv");
myFLVPlayback.getVideoPlayer(0).close();
.
.
.
myFLVPlayback.load("video.flv");

All you need to do is loading the video from VideoPlayer object within the FLVPlayback instance, i.e- using “getVideoPlayer()” method to load instead:

myFLVPlayback.getVideoPlayer(0).load("video.flv");
myFLVPlayback.getVideoPlayer(0).close();
.
.
.
myFLVPlayback.getVideoPlayer(0).load("video.flv");

Above code will work and it is very useful if you have loaded all assets at beginning and want to remove the movie clip using “removeChild()” instead of unload it. Not sure why the FLVPlayback class does not have close video stream built in…