Show a routine only if a key was pressed

Hey everyone!

I have a routine with a fixation cross presented for 60 frames, then a video for about 7s, and I want to show the next routine (positive/negative rating), only when they pressed on the space bar (signaling that they saw an emotion).

For now, I wrote in code in the second routine:
if key_resp.keys==‘space’:
continueRoutine = True
else:
continueRoutine = False

But it makes it all stop with this error: [ffpyplayer_abuffersink @ 0000017adcedef00] Removing channel layout 0x3, redundant with 2 channels
################# Experiment ended with exit code 0 [pid:9256]

Does someone know how to do this ?

Best,
Alexane