Looping movie / video

Alon Hafri ahafri at gmail.com
Fri Feb 17 16:31:26 UTC 2012


Well an update on my own post in case anyone's interested -- got it to
work by running a While loop and starting the clip over if it reached
the duration threshold for the video. First, set the Slide or
MovieDisplay object duration to 0, with the video setting StopAfter
set to "No" and EndMovieAction set to "none". Also make sure the
slide's setting for "ClearAfter" is set to "No". Then put the
following InLine after the Slide or MovieDisplay object, substituting
the relevant names:

Dim Vid1 As SlideMovie 'or as MovieDisplay object, as the case may be
Set Vid1 = CSlideMovie(yourSlide.States("Default").Objects("Movie"))
'instead of "yourSlide" put in your slide's name, or if it's a
moviedisplay object named "MovieObject", just do "Set Vid1 =
MovieObject"
Dim lngVideoOnsetTime As Long

lngVideoOnsetTime = Clock.Read
Do While... 'set the condition for the loop to end here
   If Clock.Read > lngVideoOnsetTime + [insert video duration here in
msec] Then
      Vid1.Load
      Vid1.Play
      lngVideoOnsetTime = Clock.Read
  End If
  [insert other relevant loop code here]
Loop

Vid1.Stop
Set Vid1 = Nothing


You'll need to know your video's duration. If it's a variable duration
depending on the trial, then you can add an attribute to the list
called "VideoDuration", and then replace the part in brackets above
about duration with CLng(c.GetAttrib("VideoDuration")).

Hope that helps -- if anyone knows how to loop a video in an easier
way, please post. Or if you know how to automatically read in the
video's duration so having a manually specified attribute
"VideoDuration" is not needed.

Alon



On Feb 16, 10:38 am, Alon Hafri <aha... at gmail.com> wrote:
> Hi everyone,
>
> I'd love to get your help with this! We are looking to loop a
> SlideMovie object until the Enter key is pressed. Meanwhile, the user
> may type what they see in the video (using the echo response feature
> of Input Masks).
>
> Unlike the SoundOut objects, there is no documentation on MovieDisplay
> or SlideMovie objects, and so we can't figure out if there are
> properties that allow this. David McFarlane put in a feature request
> for this herehttp://support.pstnet.com/forum/Topic2772-12-1.aspxbut
> until then, I'm wondering if someone could help me figure this out
> with InLine.
>
> With sound objects, you can do it with InLine by playing the soundout
> object, and then testing for the buffer status (e.g. the following):
> Do While ...
>    If SoundBuffer.Status = ebBufferStatusStopped Then SoundBuffer.Play
> Loop
>
> Is there an equivalent property for MovieDisplay? Or alternatively, is
> there a way to test at runtime the length/duration of a movie, so that
> we can have the program wait that long and then play the movie again?
> I guess the only other option is to manually code the duration of each
> video, and then use the InLine to wait that long before replaying the
> movie.
>
> Thanks so much for all your help!
> Alon
>
> keywords: video movie loop slidemovie moviedisplay moviebuffer status

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list