Hello!
Currently I am working on an experiment related to event segmentation. I am trying to create a custom code which allows the participant to pause a video stimulus (using ‘space’) and for the pause to last 10 seconds and automatically resume. Here is my code, hope to figure out why it is not working.
Begin experiment
is_paused = False
pause_timer = core.Clock() # Timer to track the pause duration
pause_times_SegmentationTraining = [] # List to store the pause times
Each frame
if is_paused:
if pause_timer.getTime() >= 10: # Pause for 10 seconds
is_paused = False
SegmentationTraining.play() # Resume the video
else:
keys = event.getKeys()
if 'space' in keys:
is_paused = True
SegmentationTraining.pause()
pause_times_SegmentationTraining.append(SegmentationTraining.getCurrentFrameNumber())
End routine
thisExp.addData('pause_times_SegmentationTraining', pause_times_SegmentationTraining)
Hope somebody can help:))