3 Replies Latest reply on May 3, 2006 2:04 AM by Lion-court

    Video looping before end

      Hello, I am currently working on an interactive tourist information kiosk using MX 2004. At the moment, the score of over 50 video clips placed side by side in indivudual frames. I am using the MediaPlayer Xtra to import the video clips.

      Each of these video clips in the score contains a behavior script (called movieSkip) that will make the playhead move to the next frame once the current video has finished playing. This seems to work without a problem.

      movieSkip: (attached to each video clip as a behavior)
      on exitframe me
      if sprite(1).Position < sprite(1).Duration then
      -- still playing
      go the frame
      -- end of the video
      go to frame #
      end if

      However, once the playhead moves and the next video starts, the video will only play about half way through and then the playhead will move back to the frame containing the previous video. This now means that my kiosk is caught in a loop playing the same clip and a half over and over.

      Additionally, this problem does not appear when previewing within director itself, it only seems to occur when the score is exported.

      If there is anyone who could provide me witha means to solve this problem, I would greatly appreciate it. Thank you.
        • 1. Re: Video looping before end
          Level 7

          I have not used the MediaPlayer Xtra so not well-versed in the ins and outs of
          using it, but teh principle should be teh same as any video type. What video format
          are you using by the way?

          I assume 'sprite(1).position' is MediaPlayer specific Lingo. For QT or AVI, you
          could use 'sprite(1).movieTime'
          Anyway, did you have the line 'go to frame #' in this format? It looks a bit
          weird.You could have:
          go the frame + 1
          to go to the next frame or could just leave out the else bit completely as the next
          fame would be the natuaral sequence when the condition is no longer the case.

          Next, you have
          sprite(1).duration then
          the duration usually the property of the cast member rather than teh sprite so it's
          generally better to check against the cast members duration.

          If you want to keep you behavior generic, how about writing something like:

          on exitFrame me
          -- create a reference to the video sprite
          videoSprite = sprite(me.spriteNum)
          videoCast = sprite(me.spriteNum).member

          if videoSprite.position < videoCast.duration then
          -- still playing
          go the frame
          end if

          Using 'me' in the above way will allow the behavior to be flexible. The video will
          not need to be in sprite channel 1. It does require each vidoe sprite to be 1 frame
          long. If you wanted the vidoe sprites to be longer you could change the last part

          if videoSprite.position < videoCast.duration then
          -- still playing
          go the frame
          go next
          end if

          'go next' would send the playback head to teh next marker so you'd just create
          markers in the Score for each video.

          Anyway. I've moved off the topic a bit. Maybe changing the 'duration' to refer to
          the cast and achanging the ' go to frame #' line will fix it. Let me know.


          Director Lecturer / Consultant

          • 2. Re: Video looping before end
            Level 7
            If the problem is always with the same video clip, then try substituting
            a different clip. Make a projector and test it. If your movie works with
            the new clip, then the problem is with the way that the Xtra is reading
            that clip. Try a fresh copy of the clip.

            If the problem is with different clips, or happens arbitrarily on any
            clip, then the problem may be with the Xtra. I'm not familiar with that
            Xtra, so I don't know of any problems specific to it. Look on the
            author's web site for a list of known problems and their solutions. You
            might also contact the xtra's author with a specific question about this

            Have you tried adding a blank frame between the video frames? Does the
            problem show up when you play back from a hard drive, or only from a CD?

            Rob Dillon
            Adobe Community Expert

            • 3. Re: Video looping before end
              Lion-court Level 1
              Thank you very much for both your replies. I have managed to solve the problem. It turns out that the MediaPlayerXtra specifically uses the Position and Duration properties for it's video. I created a generic script for advancing the playhead based on your advice Dean and tested it in another movie, there were no problems. Since it worked in another movie, it turned out that what was causing the playback problem was a script for a timeout loop I had previously written and had neglected to turn off. Thanks again.