Setting nReps in TrialHandler doesn't affect the number of videos played

I create the trial order like this:

trials = data.TrialHandler(stim_order, nReps=10, extraInfo=exp_info, method='random')

where stim_order has only 2 stimuli (and i want to repeat each 10 times).
But when I iterate over trials it plays only 2 videos and stops the experiment. Here is the code:

 if trial['stimulus'] == 'S1.mp4':
        mov = S1
        mov = S2

    while mov.status != visual.FINISHED:
        # draw the movie
        # flip buffers so they appear on the window

Depending on which version of MovieStim you are using, once the movie has finished once, it keeps the finished status and doesn’t reset. So, in other words, after the first time each movie has played, the while loop is always skipped because mov.status is always visual.FINISHED

There are a few ways around this.

Option 1: If you are using the most recent version of PsychoPy, try putting mov.replay() before the while loop. This reloads the movie file so it might introduce a little bit of lag at the start of the trial.

Option 2: When you initialize the MovieStim objects, use the argument loop = True , but I’m not 100% sure this will work with the “FINISHED” status.

Option 3: This is inelegant but is guaranteed to work. Create separate MovieStim objects for each individual trial. So, you have 10 copies of each movie file loaded as MovieStim, and you play each one only once.

Thanks a lot!

Option 1 worked well. I don’t see any lag.

Option 2 didn’t work. The first movie plays and then hangs and never moves on.

Option 3 worked, but it’s not really a solution for me because I want to play 150 short videos