Video Stimulus

Description

A stimulus that plays a video stored in any video file format supported by the operating system.

Note: To preserve the video’s aspect ratio on screen, x_size and y_size must be equal. When drawn, the larger dimension spans the full specified size, while the smaller dimension is scaled to maintain the aspect ratio.

Signature

stimulus/video

Required Parameters

path

Filesystem path to the video file

Optional Parameters

volume

Default

0.0

Output audio volume (floating-point value between 0 and 1, where 0 is muted and 1 is full system volume)

loop

Default

NO

If YES, the video will repeat indefinitely (or until Stop Dynamic Stimulus is invoked)

repeats

Default

0

Number of times to repeat the video. Note that the video will always play at least once, even if this value is less than one.

If loop is YES, this parameter is ignored.

ended

Variable that will be set to true after the video ends. If repeats is greater than 1, the variable will be set only once, after all repetitions are complete. If loop is YES, the variable will never be set.

alpha_multiplier

Default

1.0

Controls the transparency of the stimulus. 1.0 is fully opaque, while 0.0 is fully tranparent.

x_size

Example

5.0

Horizontal size (degrees).

If omitted, the value of y_size is used. It is an error to omit both x_size and y_size (unless fullscreen is YES).

y_size

Example

5.0

Vertical size (degrees).

If omitted, the value of x_size is used. It is an error to omit both x_size and y_size (unless fullscreen is YES).

x_position

Default

0.0

Horizontal center position (degrees)

y_position

Default

0.0

Vertical center position (degrees)

rotation

Default

0.0

Rotation (degrees)

fullscreen

Default

NO

If YES, the stimulus is sized to fill the display. In this mode, x_size, y_size, x_position, y_position, and rotation are ignored.

deferred

Options
no
yes
explicit
Default

no

Controls when the stimulus is loaded. If no, the stimulus is loaded at experiment load time. If yes, the stimulus is loaded the first time it is queued. If explicit, the stimulus must be loaded explictly with Load Stimulus.

autoplay

Default

NO

If YES, the stimulus will start playing automatically (as if by an implicit Play Dynamic Stimulus action) after it has been queued and Update Stimulus Display has been invoked. It will also stop playing automatically (as if by an implicit Stop Dynamic Stimulus action) after it has been dequeued and Update Stimulus Display is invoked.