Video
element
since
beta 0.4description
Creates a media player that supports video playback.
syntax
newVideo("ELEMENT_NAME","VIDEO_FILE_NAME")
-
"ELEMENT_NAME"
: The name of the newly-created element. -
"VIDEO_FILE_NAME"
: The video file name, including the video file format.
example
// To be filled in
Action commands
video.disable
syntax
getVideo(“ELEMENT_NAME”).disable()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.log
syntax
getVideo(“ELEMENT_NAME”).log()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.once
syntax
getVideo(“ELEMENT_NAME”).once()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.pause
syntax
getVideo(“ELEMENT_NAME”).pause()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.play
syntax
getVideo(“ELEMENT_NAME”).play()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.print
syntax
getVideo(“ELEMENT_NAME”).print()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.remove
syntax
getVideo(“ELEMENT_NAME”).remove()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.stop
syntax
getVideo(“ELEMENT_NAME”).stop()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.wait
syntax
getVideo(“ELEMENT_NAME”).wait()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.after
syntax
getX(“ELEMENT_NAME”).after(getX(“ARGUMENT_NAME”))
description
Takes an element as an argument, and adds that element’s content to the right of the element that the command is called on.
example
click to expand
@// Option 1: Pass a new element as an argument
@newTrial("option-1",
@ newText("center", "BANANA")
@ .before(newText("left", "apple"))
$ .after(newText("right", "orange"))
@ .print()
@)
@
@// Option 2: Pass an existing element as an argument
@newTrial("option-2",
@ newText("left", "apple")
@ ,
@ newText("right", "orange")
@ ,
@ newText("center", "BANANA")
@ .before(getText("left"))
$ .after(getText("right"))
@ .print()
@)
↳ Prints appleBANANAorange
to the screen.
standard.before
syntax
getX(“ELEMENT_NAME”).before(getX(“ARGUMENT_NAME”))
description
Takes an element as an argument, and adds that element’s content to the left of the element that the command is called on.
example
click to expand
@// Option 1: Pass a new element as an argument
@newTrial("option-1",
@ newText("center", "BANANA")
$ .before(newText("left", "apple"))
@ .after(newText("right", "orange"))
@ .print()
@)
@
@// Option 2: Pass an existing element as an argument
@newTrial("option-2",
@ newText("left", "apple")
@ ,
@ newText("right", "orange")
@ ,
@ newText("center", "BANANA")
$ .before(getText("left"))
@ .after(getText("right"))
@ .print()
@)
↳ Prints appleBANANAorange
to the screen.
standard.center
syntax
getX(“ELEMENT_NAME”).center()
description
Horizontally centers the element.
example
click to expand
@newButton("centered-button", "Hello, button!")
$ .center()
@ .print()
↳ Prints a horizontally centered button that says Hello, button!
.
standard.css
syntax
getX(“ELEMENT_NAME”).css(“CSS_PROPERTY”, “VALUE”)
description
Applies the specified CSS property and value pair to the element.
example
click to expand
@newText("framed-text", "Hello, text!")
$ .css("border", "solid 1px red")
@ .print()
*,
@newButton("orchid-smallcaps-button", "Hello, button!")
$ .css({"background-color":"orchid", "font-variant":"small-caps"})
@ .print()
↳ Prints Hello, text!
surrounded by a 1px solid red border. On a new line, prints a button with an orchid background color that says Hello, button!
in small caps.
optional parameters
-
getX(“ELEMENT_NAME”).css({“CSS_PROPERTY_1”:”VALUE_1”, “CSS_PROPERTY_2”:”VALUE_2”})
standard.cssContainer
syntax
getX(“ELEMENT_NAME”).cssContainer(“CSS_PROPERTY”, “VALUE”)
description
Applies the specified CSS property and value pair to the container of the element.
example
click to expand
newText("center", "BANANA")
.before(newText("left", "apple"))
.after(newText("right", "orange"))
.css("color", "red")
.cssContainer("background-color", "aqua")
.print()
↳ Prints appleBANANAorange
to the screen. The substring BANANA
has a red text color, and the entire string has an aqua background color.
optional parameters
-
getX(“ELEMENT_NAME”).cssContainer({“CSS_PROPERTY_1”:”VALUE_1”, “CSS_PROPERTY_2”:”VALUE_2”})
standard.disable
syntax
getX(“ELEMENT_NAME”).disable()
description
Disables any interactive feature of the element.
example
click to expand
@// example
standard.enable
syntax
getX(“ELEMENT_NAME”).enable()
description
Enables any interactive feature that was previously disabled.
example
click to expand
// example
standard.hidden
standard.left
syntax
getX(“ELEMENT_NAME”).left()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.print
syntax
getX(“ELEMENT_NAME”).print()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.refresh
syntax
getX(“ELEMENT_NAME”).refresh()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.remove
syntax
getX(“ELEMENT_NAME”).remove()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.right
syntax
getX(“ELEMENT_NAME”).right()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.scaling
syntax
getX(“ELEMENT_NAME”).scaling()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
that zooms an element in/out to fit the argument(s), which can be: a ratio (with 1 for 100%), a unit dimension (eg. “10vw”), or the page/screen (pass "page"
)
standard.selector
syntax
getX(“ELEMENT_NAME”).selector()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.setVar
syntax
getX(“ELEMENT_NAME”).setVar()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.size
syntax
getX(“ELEMENT_NAME”).size()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.visible
syntax
getX(“ELEMENT_NAME”).visible()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
@newText("hidden-text", "Surprise!")
@ .hidden()
@ .print()
*,
@newButton("reveal", "Click to reveal a surprise")
@ .print()
@ .wait()
*,
@getText("hidden-text")
$ .visible()
↳ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Test commands
video.test.hasPlayed
syntax
getVideo(“ELEMENT_NAME”).test.hasPlayed()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
video.test.playing
syntax
getVideo(“ELEMENT_NAME”).test.playing()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example
standard.test.printed
syntax
getX(“ELEMENT_NAME”).test.printed()
description
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
example
click to expand
// example