Skip to content

Video Stimulus

A video stimulus plays a video clip.

Required Properties

type

  • Definition: The type of stimulus
  • Possible values: For video stimuli, must be specified as video
{
  "type": "video",
  "content": "video1.mp4"
}

content

  • Definition: A pointer to the underlying resource
  • Possible values: Must be the file name of the video file (you will be prompted to upload the video file)
  • Format support is dependent upon the participant's browser. See Tips tab for further information.
{
  "type": "video",
  "content": "video1.mp4"
}
  • mp4 (encoded with the h.264-x264 codec) tends to work well across our supported browsers and all major operating systems (Windows, Mac, and Linux). However, there is a chance that older Linux systems with older browsers will not support this format.
  • For video transcoding, we recommend using the free, open-source program Handbrake.

Optional Properties

autoplay

  • Definition: Whether or not to start playing the video without participant action
  • Possible values: true or false
  • Default: true
  • Setting this option to false nullifies the delay parameter.
  • This parameter affects the video when used as a choice response as well.
{
  "type": "video",
  "content": "video1.mp4",
  "autoplay": false
}

barrier

  • Definition: If set to true, all subsequent stimuli and responses will not be displayed until this video clip finishes playing
  • Possible values: true or false
  • Default: true

{
  "type": "video",
  "content": "video1.mp4",
  "barrier": false
}
In trials using the above stimulus code, other stimuli and responses will be displayed at the same time as the video.


{
  "type": "video",
  "content": "video1.mp4",
  "barrier": true
}
In trials using the above stimulus code, the video will play before other stimuli and responses are displayed. This code is equivalent to code where the barrier property is not specified.

delay

Info

This property is used for presenting multiple stimuli on a trial in a sequence. To implement inter-trial intervals, see the delay parameter in trial templates instead.

Warning

The delaying of multiple stimuli on a trial does NOT have a chain effect. That is, the delay of any stimulus on a trial is always relative to the onset of that trial or the end of the last stimulus acting as a barrier.

  • Definition: Delay the onset of a stimulus by a certain number of seconds, relative to (1) the onset of a trial if there are no stimuli acting as barriers or (2) the end of the last stimulus acting as a barrier.
  • Possible values: A number in seconds (decimals are supported)
  • Default: 0 (no delay)

{
  "type": "video",
  "content": "video1.mp4",
  "delay": 1.6
}
The above code introduces a delay of 1600 milliseconds.

  • This property is optional but recommended for an video stimulus. If not set, the video may appear to start abruptly on a new trial.

parent

  • Definition: If specified, then the properties of the specified stimulus will be inherited by this stimulus, unless a property of the same name is defined in this stimulus
  • Possible values: The name of another defined stimulus

"video0":{
  "type": "video",
  "content": "video0.mp4",
  "delay": 0.3
  "replayable": true
  "width": "200px"
}
"video1": {
  "type": "video",
  "content": "video1.mp4",
  "parent": "video0",
  "width": "400px"
}
Here, the video1 stimulus inherits the delay and replayable properties of video0. video1 does not inherit the width property of video0 because the stimulus definition of video1 has its own specified width property.

replayable

  • Definition: If set to true, video stimuli will be greyed out once finished playing and a "replay" button will display, allowing participants to replay a video stimulus.
  • Possible values: true or false
  • Default: false
{
  "type": "video",
  "content": "video1.mp4",
  "replayable": true
}

visible

  • Definition: If set to false, the video will play in the background (which probably doesn't make sense in most cases)
  • Possible values: true or false
  • Default: true

{
  "type": "video",
  "content": "video1.mp4",
  "visible": false
}
This code probably doesn't make much sense in most cases!

width

  • Definition: The width of the video, specified in pixels
  • Possible values: A number of pixels (e.g. "200px")
  • Default: The actual size of the video
  • Height will be automatically adjusted to preserve the original aspect ratio.
  • This parameter affects the video when used as a choice response as well.
{
  "type": "video",
  "content": "video1.mp4",
  "width": "400px"
}