I’m trying to present videos in Inquisit, with the option for participants to press a key (“S”) to stop the video and display a “wait for experimenter” screen. After that, the experiment should continue with the next trial. Some videos are emotionally negative, so participants should be able to stop a video immediately and skip that trial if needed.
Problem:
The video trial does not end automatically when the video finishes playing. The video remains on screen and the experiment does not advance unless the stop key is pressed. However, pressing “S” should be optional.
Because the videos have different lengths, I can’t use a fixed /trialDuration.
What is the correct way to end a trial automatically when a video finishes, while having variable-length video files and giving an option to respond?
Relevant code elements below, runnable minimal version attached as zip.
<video videos>
/ items = item.video_files
/ position = (50, 50)
/ size = (60%, null)
/ select = noReplace
/ playThrough = false
/ erase = false
</video>
<item video_files>
/ 1 = "V1.mp4"
/ 2 = "V2.mp4"
/ 3 = "V3.mp4"
</item>
<trial trial_video>
/ stimulusTimes = [1 = video.videos, text.stop]
/ validresponse = (31)
/ responseInterrupt = immediate
/ branch = {
if (trial.trial_video.response == 31) return trial.stop_page;
}
</trial>
<trial stop_page>
/ stimulusTimes = [1 = text.stop_page_text]
/ validResponse = (1) // ESC key
/ ontrialend = {
values.video_skipped = video.videos.currentItem;
}
</trial>
Thanks very much for any advice or example code.