4 Replies Latest reply on Apr 16, 2006 9:54 AM by DoneSK

    Video Playback

    DoneSK
      Hello.

      I've would like to make a digital video play (.wmv) to the end without actually strecting all the sprite's frames to its end in the score. I know this can be done because strecthing the frames is too tedius, I doubt that's that's the only way.

      I've heard of cue points, but I'm still a bit confused as to how they work.

      Any help?
        • 1. Re: Video Playback
          Level 7
          Yes, you don't need to expand the sprite over many frames, nor do you
          need cue points.

          You can place the video sprite in the score. Let it take five frames, as
          an example.

          You can then place a behavior on the video sprite like this:

          ---------
          property thisSprite
          property thisMember
          property thisDuration

          on beginsprite me
          thisSprite = me.spriteNum
          thisMember = sprite(thisSprite).member.name
          thisDuration = member(thisMember).duration
          end

          on exitFrame me
          if sprite(thisSprite).movieTime >= thisDuration then
          -- jump to new frame or marker
          end if
          end
          -------------

          The duration is the length of the video member. The movieTime is a
          property of the video sprite. It is current time, or position, in the
          video. So, if you compare the current position in the video to its total
          length, you'll know when you get to the end.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: Video Playback
            DoneSK Level 1
            Thankyou. I however, don't understand. Where do I put this code? Is it on the digital movie sprite? Must I change any of this code so as for it to work in my situation?

            Here's what I thought I had to do;

            Right click on the digital video>Script...
            Then I added the code you gave and made a small change, it's in bold below.

            property thisSprite
            property thisMember
            property thisDuration

            on beginsprite me
            thisSprite = me.spriteNum
            thisMember = sprite(thisSprite).member.name
            thisDuration = member(thisMember).duration
            end

            on exitFrame me
            if sprite(thisSprite).movieTime >= thisDuration then
            go to frame 1
            end if
            end

            What did I do wrong?
            • 3. Re: Video Playback
              Level 7
              DoneSK wrote:

              > Thankyou. I however, don't understand. Where do I put this code?

              Seems you put the code in the right place, but maybe the line 'go to frame 1' is
              incorrect. According to the behavior, the line after:
              if sprite(thisSprite).movieTime >= thisDuration then
              should be where you want to send Director when the video has finished playing.

              You will need a frame behavior in the point the video sprite appears that says:
              on exitFrame
              go the frame
              end

              So, the frame will be playing in a loop until Rob's behavior allows you to jump to
              another point when the video has finished.

              I tend to use the opposite approach. For example, you can create a frame behavior
              that says
              on exitFrame
              if sprite(1).movieTime < member("castName").duration then go the frame
              end

              The above keeps playing the video sprite 1 until it reaches the duration of its
              cast member. When that happens, the movie will just jump to the next frame. I've
              hard coded the above, so not as reusable as Rob's one, but just wanted to show it
              in it's simplest form.

              I have a more generic behavior, similar to Rob's but where you can set the
              parameters when you apply the behavior. This is at:
              http://www.fbe.unsw.edu.au/learning/director/Lingo/paramDialog.asp

              regards
              Dean

              Director Lecturer / Consultant
              http://www.fbe.unsw.edu.au/learning/director
              http://www.multimediacreative.com.au

              • 4. Re: Video Playback
                DoneSK Level 1
                Great! Thanks. The problem was that the code doesn't work for .wmv. When I replaced it with a quicktime video, it worked. Unfortunately, I haven't been able to view my quicktime sprites for weeks. All I see is a white screen (even the .mov from a dvcontrol.dir from this site shows a white screen). So I was able to test the code with just the volume of the quicktime sprite. It played 'til the end then jumped to the frame I specified. Is there a code for .wmv?

                Thanks you guys.