1 Reply Latest reply on Aug 20, 2007 10:54 AM by Greg Dove

    How best to preload FLV's?

    roberttraum
      I'm working on a large app (taking over from someone else) -- it's a long series of FLV's, loading in response to user input. Thus you have an FLV playing, user is asked for input (in the SWF), and based on choice, one of 3 possible next FLV's is loaded.

      I'd like to preload all of the next 3 FLVs at each stage -- so that there's a smooth transition.

      I tried doing this, making the VideoPlayer invisible -- but the sound started playing for each of the video clips as they pre-loaded.

      Then I saw a method described whereby one could make a new Sound, connect this to the video clip (forgive me if this is all in pseudo-code, but I've been away from project for two weeks), and turn the sound volume to zero. This did not work for me, although I followed the instructions precisely.

      Is there any foolproof, best-practices way to preload FLVs so that one can simply switch to them when one is ready? I suspect this might be easier in AS 3.0, but I'm only really familiar with AS 2.0 --

      Any help much appreciated -- if you need further info, I can explain further

        • 1. How best to preload FLV's?
          Greg Dove Level 4
          (I've never actually done this but here'show I would approach it)

          Are you using FLVPlayback?If so, you don't need multiple instances of the FLVPlayback, because it can handle multple 'players' ...ie. multiple FLVs.

          You could use the FLVPlayback progress event to check that the first main clip has downloaded completely and then start each of the other 3 (in series or parallel?) by using activeVideoPlayerIndex to set up the loads and settings for each player.

          The events from the FLVPlayback have an extra property - vp - that indicates the player index dispatching the event (which is normally always 0 unless you have additonal players controlled by the same FLVPlayback instance), so you you can listen for each of the three extra preloads progress events as well with the same listener and understand which has finished preloading etc. from the index in the event object.

          Take a look at this example for the activeVideoPlayerIndex.
          http://livedocs.adobe.com/flash/9.0/main/00002980.html#wp3780233