OS : Windows10
PsychoPy version : v2021.2.3
Standard Standalone? (y/n) y
I am building an online experiment where participants can choose to watch the video till the end or they can press the “space” key to end the routine and therefore stop the video early. I want to save the time when the video started and when/if the “space” key was pressed.
The keyboard component works as expected but I have a problem with the movie component. Despite ticking the option “log onset/offset times” on the movie component, no times are saved in the .csv file.
What did you try to make it work?:
I build another simple experiment from scratch but still no timings saved. Then, following this topic: Onset and offset timestamps for videos
I tried to insert a code component:
logged = 0
if logged == 0:
logged = 1
elif clip.status == STARTED and logged == 1:
print('Started: '+ int(globalClock.getTime()))
logged = 2
elif clip.status == FINISHED and logged == 2:
print('Stopped: '+ int(globalClock.getTime()))
logged = 3
What specifically went wrong when you tried that?:
With the added code component and when locally, the experiment crashes at the beginning of the video routine. When online, the experiment runs but still no timings are saved for the movie component.
Please can someone help me with this issue? I have no idea how I can fix this.