psychopy.org | Reference | Downloads | Github

Stimuli stops playing!

Hello,

My experiment which includes 40 point-light stimuli stops playing on random trials. Everything (excel, script, stimuli) was uploaded on Pavlovia successfully (the experiment also plays fine in PsychoPy). Even when I try piloting, it does download all 40 stimuli in the beginning, however, it does stop playing after certain trials. For instance, once the stimulus stopped playing after the 23rd trial another time it was after the 29th trial.

Here is the link to the experiment: https://gitlab.pavlovia.org/SerenaZa/40-stimuli

Any help would be greatly appreciated.

There is currently a problem when playing movies in online PsychoPy experiments, whereby each movie is played only the first time it is presented, appearing as a static image for subsequent presentations. I suspect that the random trial that your movies stop playing at is related to the trial in which the second movie repetition is played.

It is possible to duplicate the movies under different names for subsequent repetitions, but that multiplies the resources that the participant need to download each time they run the experiment, which is undesirable. Alternatively, one could enforce only one presentation within each experimental block, which is also not ideal.

My workaround to the problem is to add a code component below the movie. The example below assumes that your movie component is called myMovie, so simply replace its name with the name of yours. For example, the code components could have a Begin Routine tab value of myMovie.play(), and an End Routine tab value of myMovie.stop() with myMovie.seek(0) on the line below that. The .stop() is optional if the end of the movie also ends the trial, or the movie does not either have or play an audio track. This solution ensures that the movie resumes at its beginning on its next presentation. But has the limitation of starting at the beginning of a trial. Although it is easy to offset the start by adding a routine before, but within the trial loop, that last for the desired delay.

Thank you so much for your quick reply. I actually did not have any stimulus in my code that was repeated twice.

However, I did try to create new experimental blocks for repeated stimuli (which is something that will be part of the final expt) to see if that would solve the problem. But that did not work either.

Can you please provide an example of the code that you mentioned here, if possible? I will try that next.

1 Like

It is a pity that was not your problem. Here is an example of what I was talking about, pavlovia.org/d.govan/movie_example_dg1

I had a quick look at your experiment and its corresponding conditions file (40 Stimuli.xlsx). I found that the source of your problem is that in column B, Liz_1_PT_SWS.mp4 appears twice (in both rows 13 and 22). Since the trial loop randomises the order of presentation (even though the number of replications is set to 1), the experiment will try to play that movie a second time on some random trial.

I hope that helps. :grinning:

Thank you for posting the link. Unfortunately that did not work for me.

@jonathan.kominsky or @apitiot do you know if there is another solution?

I am surprised that the link did not work for you.

I have now run your experiment online several times, and it consistently froze at the second playing of the Liz movie, as I expected (i.e., the movie stays static at its final frame, and the movie never ends, so neither does the trial or the experiment). I tried both random and sequential trial ordering. Changing the trial ordering to sequential is useful for debugging, because the trial order is the same as that in the conditions file.

I made a copy of your experiment and added the code component workaround (as described earlier) to make the movies play properly for subsequent presentations, restructuring it so that the movie was within its own routine within the trial loop, as required for the workaround (as demonstrated in my example linked to earlier). The modified publicly accessible experiment can be found here, pavlovia.org/d.govan/serena_z_expt. I tested it a couple of times and the movies now play properly and the experiment now runs to the end.