fullscreen

You can use the special command fullscreen to send a fullscreen request to the participant’s browser. Note that the success of this command is dependent on each browser’s configuration. Most browsers will block fullscreen requests if they happen before the user has interacted with the page in any way, so only call this command after a click or a key press has happened.

Use exitFullscreen to quit fullscreen mode

Example:

[js try=”true” try=”data” highlight=6,21]newTrial(
newButton(“Start the experiment and go fullscreen!”)
.print()
.wait()
,
fullscreen()
)

newTrial(
newScale(100)
.before( newText(“It is cold here”) )
.after( newText(“It is warm here”) )
.slider()
.print()
.wait()
)

SendResults()

newTrial(
exitFullscreen()
,
newText(“Thank you for your participation!”)
.print()
,
newTimer().wait()
)
[/js]

Through the Try-it interface, browsers usually deny fullscreen requests because the experiment is not run globally but instead from within the test page.

Published by Jeremy

Researcher in semantics and pragmatics; Programmer of PennController for IBEX