Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Stop a video playback with a keypress and record reaction time

emphyrioemphyrio Posts: 2
edited September 6 in OpenSesame

Hi,
In my experiment, the user watches a video and presses a key (let's say "space") when he sees a specific object.
At the key press, the video stops.
I then need to record the time between the beginning of the video and the time he pressed the key.
How can I do that?
Thank you for your help.
Emphyrio

Comments

  • sebastiaansebastiaan Posts: 2,737

    Hi Emphyrio,

    The start time of the video is automatically recorded as time_[name of item]. So, if we assume that your media_player_mpy item is simply called media_player_mpy, then you could determine the response time by inserting a simple inline_script directly after the media player, with the following code in the Run phase:

    var.response_time = clock.time() - var.time_media_player_mpy
    

    Does that make sense?

    Cheers,
    Sebastiaan

    Thanked by 1emphyrio

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Hi Sebastiaan,

    Yes, it does. I still have to make some tests, but it seems to work.
    Thank you very much!

    Emphyrio

Sign In or Register to comment.