MovieStim not repeating correctly

PsychoPy version 2022.2.2
OS: Windows 10 Pro
Browser: Chrome, Microsoft Edge

URL of experiment:

Description of the problem:
I’m trying to play a series of videos in a loop. have two video files. The file names and durations are specified in a conditions file. Videos are all converted according to the guidelines here: Media formats suitable for online studies — PsychoPy v2022.2.2. The video file size is about 14 MB and 2 minutes 20 seconds long. In the current version of this routine, I have a 0.5 second fixed interval component, a movie component set to start at 0.5 second, and a code component specifying the following:

Begin Routine
StudyVideo.play();

End Routine
StudyVideo.stop();
StudyVideo.seek(0);

The videos are set to alternate after each loop.

The first loop plays video #1 fine. In the second loop, there is a pause (~20 sec) on a frame further along in video #2, before the video resumes. In the third loop (should repeat video #1), I see this error message:

image

What I’ve tried to fix it:

  • This code (name of MovieStim is “StudyVideo”):
    Begin Routine
    moviestarted=0
    .
    Each Frame
    if (((t > 0.5) && (moviestarted === 0))) {
    moviestarted = t;
    StudyVideo.play();
    }
    .
    End Routine
    StudyVideo.stop();
    StudyVideo.seek(0);

  • This code:
    Begin Routine
    StudyVideo._movie.currentTime = 0;
    StudyVideo.play();
    .
    End Routine
    StudyVideo.stop();
    StudyVideo.seek(0);

Any help is appreciated!