all groups > flash (macromedia) > october 2004 >
You're in the

flash (macromedia)

group:

Delaying a FLV File.


Delaying a FLV File. MotherBrain
10/29/2004 9:16:36 PM
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.



Re: Delaying an FLV File. MotherBrain
11/1/2004 2:38:18 PM
If someone could at least point me in the right direction or to an article concerning this, it would be greatly appreciated.

Re: Delaying an FLV File. MotherBrain
11/1/2004 5:30:39 PM
Re: Delaying an FLV File. MotherBrain
11/1/2004 5:30:43 PM
Re: Delaying an FLV File. the fleece
11/1/2004 6:21:17 PM
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
Re: Delaying an FLV File. MotherBrain
11/1/2004 8:34:39 PM
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.
Re: Delaying an FLV File. the fleece
11/2/2004 11:33:38 AM
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

Re: Delaying an FLV File. MotherBrain
11/4/2004 2:44:55 PM
The Fleece,

I appreciate you taking the time to respond. The delete this.onEnterFrame() looks promising... I will need to do some more research.

AddThis Social Bookmark Button