Howdy, Stranger!

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

Supported by

Video playback and keyboard response

edited January 2017 in OpenSesame

Hi everyone,
For my lexical decision task, I play a video clip and then collect a response (left for sign and right for nonsign) on the keyboard. The subject has 2500 ms to respond from the moment the video starts playing. Ideally, the moment the key is pressed, the next trial is called. When I set the timeout for the keyboard response as 2500 and the duration for the mpy as kepress, the video just freezes and then moves on to the next trial after the remaining time. I have to press the response keys twice to record the response and move on. I tried two variations:
1.The duration for mpy as 0- the video doesn't play, a single frame appears
2. The duration for the mpy as 2500- the same as when the timeout for keyboard is 2500.

What can I do? I need to record the response time from the moment the video plays and the time available to respond is 2500ms (the videos are all between 1000-2000ms)


  • Hi NikkieK, that sounds weird. I'm going to check it out and will get back to you shortly!

    Buy Me A Coffee

  • edited January 2017

    Hi NikkieK, I think I see what is going on now. The way you've set up your experiment indeed causes the experiment to pause at the keyboard_response item. What is happening is that when you press a key during video playback, this is registered as the response to the video item. After this, the keyboard_response item directly follows, expecting another response and pausing the experiment until it gets is.

    I don't really have a simple solution to your problem. You will need to program the response handling yourself in the script section that the video player item provides. You can check for useful functions regarding setting responses. I haven't been able to check this myself, but a simple script like

    if event:
        key = event[1]
        if var.correct_response ==  key:
        responses.add(response=key, correct=correct, response_time=clock.time()-var.time_media_player_mpy)
        continue_playback = False

    in the video_player_item should do it. You will have to replace the media_player_mpy part in time_media_player_mpy with the actual name you have given your video player item.
    Don't forget to set call custom Python code to on keypress and remove the keyboard_response item after the video item.

    I hope this helps!

    Buy Me A Coffee

  • And I put 'keypress' in duration field for the media player still? Or the timeout that I want?

  • Hi Daniel,
    Thanks for the help...! It solved the playback issue...but I still haven't figured out how to solve the timeout issue. I have tried various codes but still haven't solved it (still learning python by the way). What I want to do is to allow the participant 2500ms to respond from the moment the clip starts, so if the video completes playing a blank screen needs to be displayed for the remaining time until a response is given and if no response is given the experiment moves onto the next video.

  • Right, then I made a mistake in my last post. You should set call custom Python code to after each frame and set timeout to 2500 ms. If my code is correct, it should only do something if a key is pressed.

    Buy Me A Coffee

  • Hi Daniel...I have tried what you suggested but it doesnt seem to work. And I wanted to ask...for the blank screen to be displayed for the (2500-[length of the video])ms, do i put this in a separate inline_script or in the custom python code for the video? I am not sure because the blank screen needs to be able to collect responses as well..

  • If it doesn't work, can you please tell me what goes wrong? I need more information to know where I should look.
    If the blank scren occurs after the video, then you can place it as a separate item behind the video item. You can control whether the blank screen need to appear with the run if directives you find in the sequence item.

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games