Navigation stuff goes here


Command groups: movies

Before reading this section you should first read about cells and possibly images since they're simpler than movies.

To display a movie on the screen, the movie has to be loaded into a cell. You can have up to 26 cells visible at a time, each with a different movie in. the movie will remain in the cell until something else is loaded into that cell, but you can hide the cell and show it again without having to reload the movie. Although you can have 26 movies all showing at the same time, if you try to have them all playing at the same time your computer will probably play them in jerks since it will not have time to process every frame of every movie.

Movie file formats

PsyScript understands any image file formats that your web browser understands. The most common format is QuickTime, which gives you files ending in .mov or .wmv. If your web browser can play the movie in a normal static web page, PsyScript will be able to load it into a cell.

Playing a movie

Loading a movie into a cell just allows PsyScript to display its poster frame (usually the first frame of the movie). You're probably going to want to play the movie. There are two commands you can use to do this. One starts the movie playing and waits until it has finished playing before continuing. The other starts it playing then continues with the next line of the script. If you use the second command then you cam use another command to pause the movie. This may be useful if you want to play just the beginning of the movie, or to play the movie only until the participant reacts to it.

How to play a movie for the participant

The smallest amount of code required to show a movie playing would be …

load cell M with movie demomovie.mov move cell M to (0,0) show cell M play movie in cell M

Loading is slow, and unpredictably slow

load commands commands are not only slow, but are unpredictably slow, varying by as much as a second or two depending on when caches run out of space, when anti-virus software cuts in, and all sorts of other matters. Consequently, do your load operations outside any time-critical parts of your script.

Commands

load cell value with movie value

Loads the movie from a file in the same folder as the script file into a cell

load cell A with movie llama.mov
load cell L with movie $varMovieFileName
load cell $varTargetCell with movie target.mov


load cell value with movie value from folder value

Loads the movie from a file in a subfolder of the script folder into a cell

load cell A with movie llama.mov from folder animals
load cell L with movie $varImageFileName from folder female
load cell $varTargetCell with image target.png from folder $varSelectedColour


play movie in cell value

Starts the movie in that cell playing from its current point. Pauses the script until the movie is finished. If the movie is already playing, does nothing. If the cell is not visible, the movie still plays.

play movie in cell R
play movie in cell $varTargetCell


play movie in cell value without waiting

Starts the movie in that cell playing from its current point. Continues executing the script. If the movie is already playing, does nothing. If the cell is not visible, the movie still plays.

play movie in cell R without waiting
play movie in cell $varTargetCell without waiting


pause movie in cell value

Starts the movie in that cell at its current point.

pause movie in cell R
pause movie in cell $varTargetCell


Technical notes

See also