PDA

View Full Version : Simple FLV player button plays video -- needs to load it first


ProtoC
06-06-2006, 08:01 PM
I made a simple flv player that works by clicking on a button, the button has some actionscript that tells throws a .contentPath call into the player. The video starts playing as soon as some of it is buffered. Here's the code:

on (press, release) {
razorplayer.autoPlay = true;
razorplayer.play();
razorplayer.contentPath = "http://whateversite.com/movies/Custom001.flv";
}

Problem is the media player plays it right away (or at least once it's a little ways loaded). I'd like it to play once the flv is fully loaded into the player, not when it has "just enough". What do I need to add to the code to achieve this?

I am using the Flash 6/7 mediadisplay and controller component. thanks!

mcmcom
06-06-2006, 08:42 PM
does this component have a loaded property or a

getBytesLoaded and getBytesTotal

most of them either have a boolean property (loaded) that retuns True once its 100% loaded, or they have exposed public methods that get the number of bytes currently loaded (getBytesLoaded) and the total bytes of the file (getBytesTotal)

you want it to play when getBytesLoaded = getBytesTotal

regards,
mcm

ProtoC
06-06-2006, 08:59 PM
does this component have a loaded property or a

getBytesLoaded and getBytesTotal

you want it to play when getBytesLoaded = getBytesTotal


Thanks MCM. Not sure it has one, it does have a .loaded property but I'm not sure how to integrate that into the above code or even if that's what you mean.

ProtoC
06-07-2006, 01:53 AM
Can anyone else give some further information on playing an FLV in the component section only after it is fully loaded?

Thanks,
ProtoC