9 Replies Latest reply on Apr 27, 2006 9:20 AM by qwerty1978

    FLV Event onComplete not triggering

    Level 7
      Hi,

      I have come accross an issue that many have complained about (google), but I
      have yet to find a solution...

      I am loading a series of videos and playing them with FLVPlayback component.
      I've noticed that, with certain FLV files, they play to the end, but the
      "complete" event is never sent.

      //-----CODE
      var listenerObject bject = new Object();
      listenerObject.complete = function(eventObject bject):Void {
      trace("done")
      };
      my_FLVplybk.addEventListener("complete", listenerObject);
      //-----
      "done" is traced on certain flv files and not on others... All FLV files
      have been encoded the same way using Sorenson Squeeze.

      Anyone know anything about this issue? Please...Anything would be
      appreciated.

      Thanks in advance
      Al


        • 1. Re: FLV Event onComplete not triggering
          Rothrock Level 5
          Well that is strange. I've run into this problem myself, but that was using the FLV export plugin from QuickTime. Once I went to Squeeze I was able to always get the complete event.

          You are absolutely certain that all the FLVs came through the same version of Squeeze?

          Is it reproducible? By this, I mean if you start with the same source and Squeeze it twice (to different output names) does it happen on both?

          Is there something in common/different about how the original source video was edited or created?

          And finally, you are certain that somewhere else in your code you aren't doing something like removeListener or some such?
          • 2. Re: FLV Event onComplete not triggering
            Level 7
            Hi,
            I am not the one that created these flv's, however the person that did
            assures me that they were all created the same, with the same source.
            That is what I find weird too, 2 out of 4 don't have the event. These videos
            are long and I was trying to avoid re-encoding, but I think that will have
            to be done, or perhaps try the encoder that came with Flash 8 instead of
            Squeeze? I am certain that there is nuthing in my code that removes the
            listener. I've replaced the 2 flv's that don't work with other flv's that I
            had from other sources and all videos play in order back to back with the
            complete event.

            Thanks
            Al



            "Rothrock" <webforumsuser@macromedia.com> wrote in message
            news:e0um26$fjf$1@forums.macromedia.com...
            > Well that is strange. I've run into this problem myself, but that was
            using the
            > FLV export plugin from QuickTime. Once I went to Squeeze I was able to
            always
            > get the complete event.
            >
            > You are absolutely certain that all the FLVs came through the same
            version of
            > Squeeze?
            >
            > Is it reproducible? By this, I mean if you start with the same source and
            > Squeeze it twice (to different output names) does it happen on both?
            >
            > Is there something in common/different about how the original source
            video was
            > edited or created?
            >
            > And finally, you are certain that somewhere else in your code you aren't
            doing
            > something like removeListener or some such?
            >


            • 3. Re: FLV Event onComplete not triggering
              Rothrock Level 5
              Sorry I couldn't come up with that a-ha solution. I'm still guessing it is something to do with the encoding. Like I said I've done dozens of movies with Squeeze and they all had the complete. It was only the ones using the FLV export that gave me the problem.

              Should it come down to it you can get the duration and then have a function poll the playhead location a few times a second. Not elegant, but a work around that some have used.

              Good luck and post back if you find out something.
              • 4. Re: FLV Event onComplete not triggering
                Level 7
                Thanks for your help, I appreciate it.
                I have thought of doing a function like that, but I would rather not.
                complete event is much cleaner.
                I did however find some interesting data....I ran a test on the playheadtime
                and the total time and seems that the movie stops playing just short of the
                total time that flash is telling me.

                The last thing to be traced to the output window when the video ends is
                this:

                Playing: playhead time is: 144.4
                Total play time for this video is: 144.53

                seems that the video stops short of the total time for some reason..

                I'll keep you posted on further findings..
                A



                "Rothrock" <webforumsuser@macromedia.com> wrote in message
                news:e10eim$r22$1@forums.macromedia.com...
                > Sorry I couldn't come up with that a-ha solution. I'm still guessing it is
                > something to do with the encoding. Like I said I've done dozens of movies
                with
                > Squeeze and they all had the complete. It was only the ones using the FLV
                > export that gave me the problem.
                >
                > Should it come down to it you can get the duration and then have a
                function
                > poll the playhead location a few times a second. Not elegant, but a work
                around
                > that some have used.
                >
                > Good luck and post back if you find out something.
                >


                • 5. Re: FLV Event onComplete not triggering
                  Rothrock Level 5
                  That is the same result I got when I was using the Export FLV plugin. This lead me to think it might have to do something with keyframes or the data rate or the in/out points. Nope. Coding and recoding with different variations did not produce a different result.
                  • 6. Re: FLV Event onComplete not triggering
                    The_Mick Level 1
                    I'm using Sorenson to compress to FLVs and this bug has been a pain for years. I too suspect it might have something to do with keyframes and frame rate, but since I'm not the one creating the FLVs, that's more difficult to test.

                    My solution was to dynamically create a cuepoint 0.5 seconds from the end of the animation. I set that in the on metadatareceived function. Then I attach a cuepoint listener that triggers what normally would happen at the end of the FLV.

                    Since the bug would cause the FLV to not rewind (because the end wasn't reached), I chose to turn off autorewind and instead use the cuepoint to trigger a "manual" rewind.

                    Good luck...

                    mick
                    • 7. Re: FLV Event onComplete not triggering
                      Level 7
                      Thanks guys,

                      I ended up writing a script like the others. There was no way to figure out
                      what is going on in those movies.

                      thanks again!
                      A
                      "The Mick" <webforumsuser@macromedia.com> wrote in message
                      news:e11h0s$fac$1@forums.macromedia.com...
                      > I'm using Sorenson to compress to FLVs and this bug has been a pain for
                      years.
                      > I too suspect it might have something to do with keyframes and frame rate,
                      but
                      > since I'm not the one creating the FLVs, that's more difficult to test.
                      >
                      > My solution was to dynamically create a cuepoint 0.5 seconds from the end
                      of
                      > the animation. I set that in the on metadatareceived function. Then I
                      attach
                      > a cuepoint listener that triggers what normally would happen at the end of
                      the
                      > FLV.
                      >
                      > Since the bug would cause the FLV to not rewind (because the end wasn't
                      > reached), I chose to turn off autorewind and instead use the cuepoint to
                      > trigger a "manual" rewind.
                      >
                      > Good luck...
                      >
                      > mick
                      >


                      • 8. Re: FLV Event onComplete not triggering
                        Rothrock Level 5
                        The Mick – when you say "pain for years" are you still using Squeeze 3 or so. I think there was a known issue that got fixed in 4.
                        • 9. Re: FLV Event onComplete not triggering
                          qwerty1978
                          Do you have the code that you used? I have the same problem but unsure how to dynamically create a cuepoint near the end. Any help would be greatly appreciated. I encoded using Flash 8 and have over 20 FLV's all from the same source. Some exhibit this bug and others do not. a bit frustrating to say the least.
                          Thanks!