I am having trouble with adding in coding for pausing a movie stimulus in the Builder View. I am new to coding so I am not completely sure on how things work. Although I add coding, the key that is specified in the coding does not actually pause the movie.
This is the coding that I have tried to use in my experiment which I extracted from the demo MovieStim2.py:
# Check for action keys..... for key in event.getKeys(): if key in ['escape', 'q']: win.close() core.quit() elif key in ['p', ]: # To pause the movie while it is playing.... if mov.status == visual.PLAYING: mov.pause() elif mov.status == visual.PAUSED: # To /unpause/ the movie if pause has been called.... mov.play() text.draw() win.flip()
No error message is given when I run the experiment with this coding. It seems that the key is not connected with the action that was specified as when I press the key ‘p’ nothing happens and the movie keeps on playing. If there is anyone who can give some advice on how to correct this issue, it would be much appreciated.