Show:

Exp-lookit-observation Class

These docs have moved here.

A frame to collect a video observation with the participant's help. By default the webcam is displayed to the participant and they can choose when to start, pause, and resume recording. The duration of an individual recording can optionally be limited and/or recording can be started automatically. This is intended for cases where we want the parent to perform some test or behavior with the child, rather than presenting stimuli ourselves. E.g., you might give instructions to conduct a structured interview and allow the parent to control recording.

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

   "frames": {
       "observation": {
           "kind": "exp-lookit-observation",
           "blocks": [
               {
                   "title": "Time to do the joke!",
                   "listblocks": [
                       {
                           "text": "Rip the paper"
                       },
                       {
                           "text": "Wait ten seconds"
                       }
                   ]
               }
           ],
           "hideWebcam": true,
           "hideControls": false,
           "recordSegmentLength": 10,
           "startRecordingAutomatically": false,
           "nextButtonText": "move on",
           "showPreviousButton": false
       }
   }

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-observation/component.js:74

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.

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

hideControls

Boolean

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

Whether to hide video recording controls (only use with startRecordingAutomatically)

Default: false

hideWebcam

Boolean

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

Whether to hide webcam view when frame loads (participant will still be able to show manually)

Default: false

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-observation/component.js:173

Text to display on the 'next frame' button

Default: 'Next'

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.

recordingRequired

Boolean

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

Whether a recording must be made to proceed to next frame. 'Next' button will be disabled until recording is made if so. 0 to not require recording; any positive number to require that many seconds of recording

Default: false

recordSegmentLength

String

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

Number of seconds to record for before automatically pausing. Use 0 for no limit.

Default: 300

showPreviousButton

Boolean

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

Whether to show a 'previous' button

Default: true

showWaitForRecordingMessage

Boolean

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

Whether to initially show a message saying to wait until recording starts, covering the entire frame. This prevents participants from seeing any stimuli before recording begins. Only used if recording is being started immediately.

Default: true

showWaitForUploadMessage

Boolean

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

Whether to stop media and hide stimuli with a message saying to wait for video upload when stopping recording. Do NOT set this to true if end of recording does not correspond to end of the frame (e.g. during consent or observation frames) since it will hide everything upon stopping the recording!

Default: true

startRecordingAutomatically

Boolean

Whether to automatically begin recording upon frame load

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

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

[Only used if showWaitForRecordingMessage is true] Text to display while waiting for recording to begin.

Default: 'Please wait... <br><br> starting webcam recording'

waitForRecordingMessageColor

Boolean

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

[Only used if showWaitForRecordingMessage is true] Background color of screen while waiting for recording to begin. See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value for acceptable syntax: can use either color names ('blue', 'red', 'green', etc.), or rgb hex values (e.g. '#800080' - include the '#'). The text on top of this will be either black or white depending on which will have higher contrast.

Default: 'white'

waitForUploadMessage

Boolean

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

[Only used if showWaitForUploadMessage is true] Text to display while waiting for recording to begin.

Default: 'Please wait... <br><br> uploading video'

waitForUploadMessageColor

String

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

[Only used if showWaitForUploadMessage is true] Background color of screen while waiting for recording to upload. See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value for acceptable syntax: can use either color names ('blue', 'red', 'green', etc.), or rgb hex values (e.g. '#800080' - include the '#'). The text on top of this will be either black or white depending on which will have higher contrast.

Default: 'white'

waitForWebcamImage

String

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

[Only used if showWaitForUploadMessage and/or showWaitForRecordingMessage are true] Image to display along with any wait-for-recording or wait-for-upload message. Either waitForWebcamImage or waitForWebcamVideo can be specified. This can be either a full URL ('https://...') or just a filename, which will be assumed to be inside `baseDir/img/ if this frame otherwise supports use of baseDir`.

Default: ''

waitForWebcamVideo

String

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

[Only used if showWaitForUploadMessage and/or showWaitForRecordingMessage are true] Video to display along with any wait-for-recording or wait-for-upload message (looping). Either waitForWebcamImage or waitForWebcamVideo can be specified. This can be either an array of `{'src': 'https://...', 'type': '...'}` objects (e.g. providing both webm and mp4 versions at specified URLS) or a single string relative to `baseDir/<EXT>/` if this frame otherwise supports use of `baseDir`.

Default: ''

Events

hasCamAccess

When recorder detects a change in camera access

Event Payload:

hideWebcam

Webcam display hidden from participant

hideWebcam

Webcam display hidden from participant

pauseVideo

When pausing study, immediately before request to pause webcam recording

recorderReady

When video recorder has been installed

recorderTimeout

Video recording automatically paused upon reaching time limit

showWebcam

Webcam display shown to participant

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