Hi! I’m running my experiment off Pavlovia so I’m looking for a solution either in the builder or using PsychoJS code (it works as intended in PsychoPy already).
I’m trying to make a video play constantly throughout repeated trials of a routine. By default, it starts over on every repeat. To give more context, this is a stroop task with a video playing on the side, so I’d like the video to keep playing while the words change.
I found a partial solution…commenting out [ myvid.stop(); ] in my JS code on gitlab seems to do the trick, but then I can’t make any changes in the builder and resync it with Pavlovia, which isn’t ideal. So, is there either a way to:
a) Stop that line from being run via a code component in the builder, or
b) Get the video to play constantly some other way?
Thank you! I don’t think I did exactly what you meant, but I was able to get it to work by creating the video object manually and using play() as you said. @sotiri I have it working now, but thanks!
This is what I did to get the video to play continuously through multiple trials of the same routine and even carry over into a different routine:
I created the video component normally and set up the settings (mostly just size/position) as I’d like.
I generated the JS code (File > Export HTML) and copied the MovieStim object creation from it. Mine was:
I disabled the video component, then added a code component to the routine and pasted the above code into JS “Begin Experiment.”
I added this to “Begin Routine” since I wanted it to play as soon as the routine started:
myvid.setAutoDraw(true);
myvid.play();
To stop the video, I added a code component to the next routine, and in “Begin Routine” I added:
myvid.stop();
myvid.setAutoDraw(false);
I put it on the next routine instead of “End Routine” since my video is to play during many repetitions of that routine, so it would’ve required extra coding to specify that that code would only be executed on the last repetition/trial of it.