PDA

View Full Version : FLVPlayback Stops Loading After Playing 2 Movies Consecutively


BKewl
09-14-2006, 02:34 AM
I'm trying to play several .flv files in a row using FLVPlayback (Flash MX Pro), but after about the second one, it gets stuck in the loading phase (that is, it gets stuck loading the third one) and never recovers. All of the videos are local, and all of the file names are valid. If I play the first and ninth videos and then try the third, the third won't play. However, if I retest the movie and play the first and then third videos and then the ninth, this time the ninth fails and the other two are fine.

My loading code looks like this:

function loadAMovie(path:String) {
if (myFLV.contentPath != path) {
myFLV.load(path);
myFLV.seek(0);
if (isPlaying) {
myFLV.play();
}
}
}

The only solution I could find online was basically deleting and recreating the player, which seems like a hugely inefficient way to go about fixing the problem. Any ideas for other solutions?

sleekdigital
09-14-2006, 03:44 AM
Check out my posts on this thread...

http://www.actionscript.org/forums/showthread.php3?t=112956

BKewl
09-14-2006, 05:05 AM
That seems to have done it, thanks SleekDigital :) Coincidentally, that was exactly the solution I had seen before but thought it may have been too inefficient. I still don't quite understand why the docs say the following in the "Playing Multiple FLV Files" section:

"You can play FLV files sequentially in an FLVPlayback instance simply by loading a new URL in the contentPath property when the previous FLV file finishes playing."

The sample code makes it look as though all you have to do is change the contentPath to get a new video in there. However, when you go into the "Using Multiple Video Players" section, they tell you how to play multiple ones in "one FLVPlayback instance." But the "Playing Multiple FLV Files" code looks like it's for a single instance, too. :confused:

sleekdigital
09-14-2006, 02:01 PM
The difference in the "Using Multiple Video Players" section is this... "and switch between them as they play". If you always wait until a video is completely finished playing before switching to the next one, just setting the contentPath might work fine. But if you switch to another video while the first is still playing... that is where I've run into problems which were solved by the code I posted (which as you probably noticed is similar to what they do in the "Using multiple video players" section). Both help section examples are using a single instance of the FLV Playback. But under the hood, FLVPlayback uses a "Video Player" object and multiple instances of that can be used withing the single instance of FLV Playback. That is what they are talking about in the "Using multiple video players" section.