2 Replies Latest reply on Feb 1, 2007 5:04 AM by MotionMaker

    Preloading FLV

    dejanFlash
      I need a help about preloading flv file while previous one is already playing on the stage. I don't use FLV playback component but a simple video holder. And I load and play flv with this actions:

      var my_nc:NetConnection = new NetConnection();
      my_nc.connect(null);
      var sea_ns:NetStream = new NetStream(my_nc);
      myVideoHolder.attachVideo(sea_ns);
      sea_ns.play("extdata/content/flv/videoClip.flv");

      In order to preload new flv while previous one is playing do I need to build a new video holder ? if yes where is the best place to put it so that it doesn't slow the processor.
      Thanks a lot,
      Dejan
        • 1. Re: Preloading FLV
          shikozel Level 1
          suggestion: use setBuffer time instead loading in background:

          var connection_nc:NetConnection = new NetConnection();
          connection_nc.connect(null);
          var stream_ns:NetStream = new NetStream(connection_nc);
          stream_ns.setBufferTime(3);
          my_video.attachVideo(stream_ns);
          stream_ns.play("video1.flv");

          but if you still want to load in the background you can load it on another MC pause it and set the MC _alpha to 0
          • 2. Re: Preloading FLV
            MotionMaker Level 1
            FLVs do not need a preloader. However you may be thinking you want to cue it up before the last one finishes and in which case you want two NetStream objects and switch them. You can play the next stream and keep it hidden. You probably want NetStream.play() followed by NetStream.pause();

            Keep in mind that once you connect to an FLV, it downloads whether or not it is playing.