flash (macromedia):
I am using the MediaDisplay component to play an external flv (flash video file). Currently, I have some actionscript code that will pause the video for 20 seconds to let the "stream" download and then start playing. Using time has some draw backs. Ideally I would like to have the video pause until a specific percentage of the video has "streamed". For example, pause the video until 30% of the flv file has been downloaded and then start playing the video. Any help would be greatly appreciated.
If someone could at least point me in the right direction or to an article concerning this, it would be greatly appreciated.
the media component has a bytesLoaded, bytesTotal and also a progess Event. you should be able to do some calculations for the required buffer time. (look it up in the components dictionary under media class you need also to take into account bandwidth The bandwidth profiler (in the debug window) also has a value called preload which tells u how many secs at the specified bandwidth the movie will need. so you could import the flv, debug it at the appropr bandwidth and note down the preload value. hope that helps
Thanks for your response "the fleece". If I use the percentage, lets say, start playing after 30%, how do I keep the code from playing over and over again? Looping as the swf playhead moves through the movie (not the video). Even if there is only one frame.
depends how you do it - if its an onEnterFrame you can just: delete this.onEnterFrame from within it or on the time line you can just remove the movieclip looping or use a gotoAndPlay to jump out of the loop ang Im sure there are 100 other ways
The Fleece, I appreciate you taking the time to respond. The delete this.onEnterFrame() looks promising... I will need to do some more research.
Don't see what you're looking for? Try a search.
|