Video stimuli not resetting to beginning in online experiment

Thanks for the tips!
Sam

1 Like

No problem.

After further experimentation, and for completeness, I will add this additional finding:

Only if a trial finishes before the end of the movie or the movie is set to loop, then the movie’s sound will continue to play until finished or will loop until the end of the experiment, which is far from ideal. The solution to this problem is to use a Code component as described above, and then adding myMovie.stop() just above myMovie.seek(0) under the End Routine tab (the .stop() is not necessary if the end of the movie also ends the trial, or the movie does not either have or play an audio track). Evidently, a movie’s sound is stopped automatically only when the end of the movie triggers the end of the trial.

Again, hopefully these workarounds will become unnecessary soon, with newer versions of the Builder.

1 Like

gitlab experiment: https://gitlab.pavlovia.org/mmemeo/test_intentions

Hi guys,
I’m having the same issue you experienced: the videos are not refreshing after each trials but they seem to be frozen at the frame in which participants press a button.
I need my participants to answer while the video is playing. I read all your helpful comments and the final version of Code Component I used is:

Begin Routine

moviestarted = 0

Each Frame

if t > .05 and moviestarted == 0:
    moviestarted = t
    myMovie.play()
for key in event.getKeys():
    if key in ['p','d']:
        continueRoutine = False

End Routine

myMovie.stop
myMovie.seek(0)

I wonder what I’m doing wrong and I really hope you can help me.
Thanks a lot!

Maybe try this post for a specific fix for Chrome:

I solved similar problems I had when playing videos for a second time by combining some of the approaches mentioned in this thread and in others:

End Routine

myMovie.stop();
myMovie.seek(0);

Begin Routine
(the one supposed to play the video for the second time)

myMovie._movie.currentTime = 0;
myMovie.play();

I also posted this in the thread Videos are not played multiple times in Pavlovia
A note on the video solution to use movie.play() in the code component.
Because this goes in ‘begin routine’, it seems to start the video as soon as the routine starts whether it is onscreen or not - i.e. you may not want it to play until after a 1second fixation. so set it to start at 1, however the video will actually have already been playing for 1 second before it actually appears.

This issue has made all my timings completely wrong, and so I hope others see this and don’t make the same mistake.

To resolve I have put the fixation in a separate routine.