6 Replies Latest reply on May 19, 2013 5:22 AM by jwombwell

    Preloader for a FLV

    jwombwell

      Hi!

       

      I have a movie embedded in a swf - the flv instance name is "montage" - I want it to play smoothly but don't want to wait for the whole thing to download because it is too long.  But this does not seem to be working - Any suggestions?  (I need hand holding with code!).  Thanks

       

      bytesload = _root.montage.getBytesLoaded();

      bytestotal = _root.montage.getBytesTotal();

      percent = Math.floor(bytesload / bytestotal * 100);

      bar.gotoAndStop(percent);

      if (percent == 50)

      {

                gotoAndStop("movie");

      }

      else

      {

                gotoAndPlay("loop");

      }

        • 1. Re: Preloader for a FLV
          kglad Adobe Community Professional & MVP

          is your flv the contentPath of an flvplayback component?  if yes, is the component's instance name flv?

          • 2. Re: Preloader for a FLV
            jwombwell Level 1

            The instance is FLVPlayback and I named it montage - the content path is montage2.flv.  Should it be something like

            _root.contentPath.montage2.flv.getBytes Loaded?

            • 3. Re: Preloader for a FLV
              kglad Adobe Community Professional & MVP

              unless you want to encode a sophisticated preloader that detects the user's download rate and then determines when to start playing the flv so it just completes loading as the end of it plays, you can just preload about 10 seconds of the flv using:

               

              montage.autoPlay=false;

              montage.contentPath="montage.flv";

              clearTimeout(playTO);

              var playTO:Number=setTimeout(10000,playF);  // set the preload duration here

              function playF():void{

              montage.play();

              }

              1 person found this helpful
              • 4. Re: Preloader for a FLV
                jwombwell Level 1

                It seems like everyone would want the sophisticated preloader - it should just come with the component!  wouldn't it be the best thing when you are going to place a small video on your site?

                • 5. Re: Preloader for a FLV
                  kglad Adobe Community Professional & MVP

                  not really but, it doesn't matter what you or i think about what should be built-into the flvplayback componenet.  it is what it is and nothing you (or i) say will make any difference.

                   

                  you could search for another component that does what you want but i doubt it exists.  you could create one yourself but that might be beyond your current capabilities and time-constraints.  or, you could hire someone to create it for you but i'm not sure that's worthwhile either.

                  • 6. Re: Preloader for a FLV
                    jwombwell Level 1

                    I guess what I meant is everyone would want their videos to run smoothly - and I want to do everything that I can to make that happen.  I am definitely going to try the script that you gave me.  Do you know anthing about the buffer time in the video component?  If I change that time it does not seem to do anthing.