Show:

Exp-lookit-instructions Class

These docs have moved here.

A frame to display instructions to the user. The user's webcam may optionally be displayed, and audio and video clips may be included in the instructions (and may be required to be played before moving on).

Each element of the 'blocks' parameter is rendered using Exp-text-block.

"frames": {
       "instructions": {
           "kind": "exp-lookit-instructions",
           "blocks": [
               {
                   "title": "Parent's role",
                   "listblocks": [
                       {
                           "text": "Follow instructions"
                       },
                       {
                           "text": "Only do each joke once"
                       }
                   ]
               },
               {
                   "text": "It's important that we can see you",
                   "image": {
                       "alt": "Father holding child looking over his shoulder",
                       "src": "https://s3.amazonaws.com/lookitcontents/exp-physics/OverShoulder.jpg"
                   },
                   "title": "Camera position"
               },
               {
                   "text": "Here's some audio you have to play",
                   "title": "Test",
                   "mediaBlock": {
                       "text": "You should hear 'Ready to go?'",
                       "isVideo": false,
                       "sources": [
                           {
                               "src": "https://s3.amazonaws.com/lookitcontents/exp-physics-final/audio/ready.mp3",
                               "type": "audio/mp3"
                           },
                           {
                               "src": "https://s3.amazonaws.com/lookitcontents/exp-physics-final/audio/ready.ogg",
                               "type": "audio/ogg"
                           }
                       ],
                       "mustPlay": true,
                       "warningText": "Please try playing the sample audio."
                   }
               },
               {
                   "text": "Here's a video you don't have to play!",
                   "title": "Test",
                   "mediaBlock": {
                       "text": "Look at that.",
                       "isVideo": true,
                       "sources": [
                           {
                               "src": "https://s3.amazonaws.com/lookitcontents/exp-physics-final/examples/7_control_same.mp4",
                               "type": "video/mp4"
                           },
                           {
                               "src": "https://s3.amazonaws.com/lookitcontents/exp-physics-final/examples/7_control_same.webm",
                               "type": "video/webm"
                           }
                       ],
                       "mustPlay": false
                   }
               }
           ],
           "showWebcam": true,
           "webcamBlocks": [
               {
                   "title": "Some webcam instructions",
                   "listblocks": [
                       {
                           "text": "Like this!"
                       },
                       {
                           "text": "Be careful your webcam does not have tape over it"
                       }
                   ]
               }
           ],
           "nextButtonText": "Next"
       }
}

Methods

destroyRecorder

()
Destroy recorder and stop accessing webcam

hideRecorder

()
Hide the recorder from display. Useful if you would like to keep recording without extra UI elements to distract the user.

makeTimeEvent

(
  • eventName
  • extra
)
Object
Extend any base time event capture with information about the recorded video

Parameters:

Returns:

Object:

Event data object

onRecordingStarted

()
Function called when frame recording is started automatically. Override to do frame-specific actions at this point (e.g., beginning a test trial).

setupRecorder

(
  • element
)
Promise
Set up a video recorder instance

Parameters:

  • element Node
    A DOM node representing where to mount the recorder

Returns:

Promise: A promise representing the result of installing the recorder

showRecorder

()
Show the recorder to the user. Useful if you want to temporarily show a hidden recorder- eg to let the user fix a problem with video capture settings

startRecorder

()
Start recording

Returns:

Promise Resolves when recording has started

stopRecorder

()
Stop the recording

Returns:

Promise A promise that resolves when upload is complete

whenPossibleToRecordObserver

()
Observer that starts recording once recorder is ready.

Properties

audioOnly

Number

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:158

Whether to do audio-only (vs also video) recording. Can be overridden by consuming frame.

Default: 0

autosave

Number private

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:149

Whether to autosave recordings. Can be overridden by consuming frame. TODO: eventually use this to set up non-recording option for previewing

Default: 1

blocks

Object[]

Specific to this element. Defined in app/components/exp-lookit-instructions/component.js:258

Array of objects specifying text/images of instructions to display under webcam view (if webcam is shown)

Sub-properties:

  • title String

    Title of this section

  • text String

    Paragraph text of this section

  • listblocks Object[]

    Object specifying bulleted points for this section. Each object is of the form: {text: 'text of bullet point', image: {src: 'url', alt: 'alt-text'}}. Images are optional.

blocks

Object[]

Specific to this element. Defined in app/components/exp-lookit-instructions/component.js:172

Array of blocks for Exp-text-block, specifying text/images of instructions to display

Sub-properties:

  • title String

    Title of this section

  • text String

    Paragraph text of this section

  • listblocks Object[]

    Object specifying bulleted points for this section. Each object is of the form: {text: 'text of bullet point', image: {src: 'url', alt: 'alt-text'}}. Images are optional.

  • mediaBlock Object

    Object specifying audio or video clip to include (optional). mediaBlock should be of form: {title: 'title text to show above audio', text: 'text to show below controls', warningText: 'Text to show in red if user tries to proceed but hasn't played; only used if mustPlay is true', sources: 'sources Array of {src: 'url', type: 'MIMEtype'} objects specifying audio sources', isVideo: 'boolean, whether video or audio', mustPlay: 'boolean, whether clip has to be played to proceed'}

doUseCamera

Boolean

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:165

Whether to use the camera in this frame. Consuming frame should set this property to override if needed.

Default: true

maxRecordingLength

Number

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:133

Maximum recording length in seconds. Can be overridden by consuming frame.

Default: 7200

maxUploadSeconds

Number

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:140

Maximum time allowed for video upload before proceeding, in seconds. Can be overridden by researcher, based on tradeoff between making families wait and losing data.

Default: 5

nextButtonText

String

Specific to this element. Defined in app/components/exp-lookit-instructions/component.js:314

Text to display on the 'next frame' button

Default: 'Start the videos! \n (You\'ll have a moment to turn around.)'

recorder

VideoRecorder private

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:92

The recorder object, accessible to the consuming frame. Includes properties recorder.nWebcams, recorder.hasCamAccess, recorder.micChecked, recorder.connected.

recorderElement

String private

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:117

JQuery string to identify the recorder element.

Default: '#recorder'

recorderReady

Boolean private

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:125

Whether recorder has been set up yet. Automatically set when doing setup. Accessible to consuming frame.

showPreviousButton

Boolean

Specific to this element. Defined in app/components/exp-lookit-instructions/component.js:304

Whether to show a 'previous' button

Default: true

showWaitForRecordingMessage

Boolean private

showWaitForUploadMessage

Boolean private

showWebcam

Boolean

Specific to this element. Defined in app/components/exp-lookit-instructions/component.js:160

Whether to display the user's webcam

Default: false

startRecordingAutomatically

Boolean

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:173

Whether to start recording ASAP (only applies if doUseCamera). Consuming frame should set to override if needed.

Default: false

stoppedRecording

Boolean private

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:108

Whether recording is stopped already, meaning it doesn't need to be re-stopped when destroying frame. This should be set to true by the consuming frame when video is stopped.

videoId

String private

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:181

A video ID to use for the current recording. Format is videoStream_<experimentId>_<frameId>_<sessionId>_timestampMS_RRR where RRR are random numeric digits.

videoList

List private

Inherited from Video-record (click for formatted description): app/mixins/video-record.js:100

A list of all video IDs used in this mixin (a new one is created for each recording). Accessible to consuming frame.

waitForRecordingMessage

Boolean private

waitForRecordingMessageColor

Boolean private

waitForUploadMessage

Boolean private

waitForUploadMessageColor

String private

waitForWebcamImage

String private

waitForWebcamVideo

String private

Events

hasCamAccess

When recorder detects a change in camera access

Event Payload:

pauseVideo

When pausing study, immediately before request to pause webcam recording

recorderReady

When video recorder has been installed

stoppingCapture

Just before stopping webcam video capture

unpauseVideo

When unpausing study, immediately before request to resume webcam recording

videoStreamConnection

When recorder detects a change in video stream connection status

Event Payload:

  • status String

    status of video stream connection, e.g. 'NetConnection.Connect.Success' if successful