5 Replies Latest reply on Dec 26, 2006 1:49 AM by arunbe

    After FLV has finished in external swf

    ccoppen
      Here's my problem:
      I have a photo slideshow which pulls from a xml file.

      The first photo is actually a flv file. In the code I dynamically point to a videos.fla file to play the flv.
      The flv is also random and each has a different length.

      I used the setInterval to go to the next photo after a certain amount of time.
      This presents a problem if the flv is not exactly the length of the duration and I end up with a blank stare or cutting off too early. I have tried multiple ways to determine the length of the flv and change the duration for the first video. What would be the best way to accomplish this. I've tried setting _globals and even trying to call the flvplayback component inside the external swf. Here's my code for both files:
      Any thoughts or help. A view of the slideshow without the video is at http://www.ciu.edu.
        • 1. Re: After FLV has finished in external swf
          arunbe Level 1
          I can suggest you onething !
          Instead of using the flvplayer component.
          you can use the vide display component.
          So that you can trace out the length of all flv files.
          You can also use the metadata details
          But,what you have to do it just use the videodisplay to display the flv files.
          and load them dynamically using the NetStreams.
          • 2. Re: After FLV has finished in external swf
            ccoppen Level 1
            I'll try that and let you know how it works. Thanks for replying so quickly. I'm trying to get this up today before my week-long break next week.
            • 3. Re: After FLV has finished in external swf
              ccoppen Level 1
              I've completely modified the whole thing, but still nothing.
              I've tried setting a global variable for the total time. In the swf file that's loading, I can grab the totaltime using the metadata.duration, and when I assign it to the _global.totaltime, I can trace it. I cannot access this variable from the parent movie though, for some reason.
              Here's the code for the parent movie:
              if (image[0].substr(-3, 3) == "flv") {
              _global.totaltime;
              loader.contentPath = "flash/playFLV.swf?video="+image[0];
              //loader.contentPath = "flash/playFLV.swf?video=http://www.helpexamples.com/flash/video/clouds.flv";

              loader_num(totaltime);


              inside playFLV.swf:
              _global.my_ns.onMetaData = function(myMeta) {
              for (var i in myMeta) {
              trace(i+":\t"+myMeta );
              }
              _global.totaltime = Math.floor(myMeta.duration)*1000;
              trace(_global.totaltime);
              };

              Any thoughts now?
              • 4. Re: After FLV has finished in external swf
                arunbe Level 1
                Try out this code
                • 5. Re: After FLV has finished in external swf
                  arunbe Level 1
                  I forgot to mention important line.
                  Before playing the netstream add this line.
                  to integerate the video with the vide display component.

                  videoDisplay.attachVideo(netStream_ns)