5 Replies Latest reply on Aug 20, 2007 4:03 PM by tallscot

    Windows Media Video - at end, go next?

    tallscot Level 1
      Hello,

      I've been searching this forum for this answer and haven't found it. I also have been doing trial and error using the manual and I can't get it to work.

      I want my playback head to go to the frame while a Windows Media Video is playing. At the end of the movie, I want it to "go next".

      I have this, but it's not continuing:

      on exitFrame me
      if the PlayRate of sprite 1 = 1 then
      go to the frame
      end if

      This isn't working because Director thinks it's still playing even though the end of the movie has been reached. I do not have Looping turned on.

      So I figured I needed to find out the duration of the movie in ticks and then do some Lingo that's based off of that, but I don't know how to do that.

      Any tips are greatly appreciated.

      Thanks!
        • 1. Windows Media Video - at end, go next?
          Applied CD Level 1
          Try this for starters. Name your video sprite “videoSprite” or substitute the sprite number in the frame script below:

          on exitFrame me
          if sprite(“videoSprite”).movieTime < (sprite(“videoSprite”).member.duration-200) then
          _movie.go(_movie.frame)
          end if
          end

          or, if you want a behavior that can be attached to the video sprite itself:

          on exitFrame me
          if sprite(me.spriteNum).movieTime < (sprite(me.spriteNum).member.duration-200) then
          _movie.go(_movie.frame)
          end if
          end

          You’ll notice that we subtract 200ms from the movie duration. Many years ago we found that sometimes either the duration reported wasn’t exactly correct or the movie simply stopped playing a few milliseconds before the real end of file. Either way we build a little “slop” into the comparison just to be safe (200ms = about 6 frames @ 30 fps, you’ll never miss them)

          This script polls the video duration before every loop, you could make it a little more efficient by storing the duration but we’ve never had a problem.
          • 2. Re: Windows Media Video - at end, go next?
            tallscot Level 1
            Thank you so much for your reply.

            I tried this and it never goes past the video. It's just stuck playing on that frame, like it never reached the full duration, even though it did.

            Thanks
            Scot
            • 3. Re: Windows Media Video - at end, go next?
              tallscot Level 1
              OK, I got it. I used the Message window and "put" to get the total time, then used this:

              on exitFrame me
              if sprite(1).currentTime < 47250 then
              go to the frame
              end if
              end

              Thanks!
              • 4. Re: Windows Media Video - at end, go next?
                Applied CD Level 1
                Hmmm … if you put sprite(1).member.duration you should also get 47250. The only reason I suggest using the member reference rather than hard coding the duration is that it will automatically adjust if you edit your video to a new duration.
                • 5. Re: Windows Media Video - at end, go next?
                  tallscot Level 1
                  Yeah, it's acting weird.

                  Thanks again for your time.