Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

OpenSesame logging response time using the media player

Hi,

I am trying to use the media player plugin to show a video stimulus and record the response time of participants with a keyboard response from the start of the video to when they press the spacebar. From what I've gathered, the coroutines plugin would be ideal to do this, but it does not work with the media player.

Are there other solutions or workarounds to doing this? I'm quite new to OpenSesame and do not have any previous experience coding in Python either. Thank you!

Comments

  • Hi @hikai,

    I'm no expert with the use of videos in OS, but I did once helped another user with a similar problem. I think it should help you solve the problem: https://forum.cogsci.nl/discussion/7425/solved-video-stimuli-and-response-time#latest

    Best,

    Fabrice.

    Buy Me A Coffee

  • @Fab thank you for the response!

    Using that implementation helped a lot, but the issue I'm encountering now is registering the response only when the spacebar is pressed.

    With the current code, any random keyboard press or mouseclick is triggering the event code, but I only want that to happen when the spacebar is pressed. I've tried setting a correct_response variable inside the trial loop and in the media player a bunch of different ways but nothing seems to be working for me.

  • Hi @hikai,

    Defining the correct response will make no difference to what keys are allowed. What you need to do is edit your Python code to make sure that the code dealing with response registration is not executed if the key pressed is not the space bar.

    In the example I referred you to, you simply have to edit the if statement to add and event[1]=='space' as the third condition:

    if event and clock.time()>time_buffer and event[1]=='space':
    

    Good luck!

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.