Preloading multiple videos in builder for fMRI experiment using a static component

OS: macOS Version 10.15.7
PsychoPy version : v2022.2.1
**Standard Standalone: Y
**What are you trying to achieve?:

I am running an fMRI experiment where a trial consists of 6, 30-second videos that are randomly presented consecutively. There are 6 trials. A trial starts after a trigger is sent from the fMRI scanner. I’m finding that the start time of the first video is inconsistent between trials.

I want to try preloading the videos before my trials to try and reduce the jitter between the fMRI trigger and the start of the first video, between trials.

I’ve tried using a static component and attempted to preload all my videos before I started my trials in the component called Preloading. This works for the first video in the trial but then Psychopy crashes and I get this error…

Videos.play()

File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/visual/movies/init.py”, line 319, in play
self._player.play(log=log)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/visual/movies/players/ffpyplayer_player.py”, line 811, in play
self._assertMediaPlayer()
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/visual/movies/players/ffpyplayer_player.py”, line 748, in _assertMediaPlayer
raise RuntimeError(
RuntimeError: Calling this class method requires a successful call to load first.
################ Experiment ended with exit code 1 [pid:45936] #################

The videos are stored in a conditions file that I upload through the loop.

Not sure where I’m going wrong…Any help on where I can go from here?
Thanks!

To answer my question, I was able to implement the code component found in this thread…

1 Like