Show:

Exp-video-config-quality Class

These docs have moved here.

Video configuration frame showing webcam view at right and instructions for checking video quality for preferential looking setup at left. Default content is hard-coded to provide a reasonable set of instructions for preferential looking setups, so the frame can be used as follows with no parameters besides kind:

"frames": {
    "video-quality": {
        "kind": "exp-video-config-quality"
    }
}

Optionally, participants can be required to check off each item before they can proceed to the next frame. If requireItemConfirmation is true (default), then the 'next' button will appear disabled until the participant has checked off all buttons, although if they click it anyway they will get an informative warning and the instructions section will scroll to the first unchecked item.

Participants can also be optionally required to create and view a short recording, e.g. to check their child will be audible or their child's eyes will be visible in a particular position.

You can also customize any or all text and images as in the following example.

"frames": {
    "video-quality": {
        "kind": "exp-video-config-quality",
        "title": "Webcam setup for preferential looking",
        "introText": "We'll be analyzing where your child chooses to look during the videos--but only if we can tell where that is! Please check each of the following to ensure we're able to use your video:",
        "requireItemConfirmation": true,
        "completedItemText": "Did it!",
        "instructionBlocks": [
                    {
                        "text": "<strong>Make sure the webcam you're using is roughly centered</strong> relative to this monitor. This makes it much easier for us to tell whether your child is looking to the left or right!",
                        "image": {
                            "src": "https://s3.amazonaws.com/lookitcontents/website/centering.png",
                            "alt": "Example images of using centered external webcam on monitor or built-in webcam on laptop."
                        }
                    },
                    {
                        "text": "<strong>Turn off any other monitors</strong> connected to your computer, besides the one with the centered webcam. (If there's just one monitor, you're all set!)",
                        "image": {
                            "src": "https://s3.amazonaws.com/lookitcontents/website/monitors.png",
                            "alt": "Example images showing laptop screen turned off if using external monitor and webcam, or external monitor turned off if using built-in webcam and laptop screen."
                        }
                    },
                    {
                        "text": "Check the lighting by making sure you can <strong>clearly see your own eyes</strong> on the webcam view to the right. You may need to either turn on a light or reduce light coming from behind you.",
                        "image": {
                            "src": "https://s3.amazonaws.com/lookitcontents/website/lighting.png",
                            "alt": "Example images showing good lighting, room too dark, and backlit scene where eyes are not visible."
                        }
                    },
                    {
                        "text": "If it's practical, <strong>minimize exciting things</strong> that are visible behind or to the side of the screen--for instance, by facing a wall instead of the kitchen. (If this isn't practical for you, don't worry about it--just check the box!)",
                        "image": {
                            "src": "https://s3.amazonaws.com/lookitcontents/website/distractions.png",
                            "alt": "Example images showing a child and puppy next to the computer, versus a computer just on its own."
                        }
                    },
                    {
                        "text": "During the study, we'll ask that you sit facing away from the monitor, holding your child over your shoulder, like this. (More on that in a moment!) <strong>Make sure the webcam is angled up or down enough that your child's eyes are visible in this position</strong>. If you're not sure if your child's eyes will be visible, you can make a short recording to check!",
                        "image": {
                            "src": "https://s3.amazonaws.com/lookitcontents/website/over_shoulder.jpg",
                            "alt": "Example image showing a dad holding his child looking over his shoulder."
                        }
                    }
                ],
            "requireTestVideo": true,
            "showRecordMenu": true,
            "recordingInstructionText": "You should be able to see your camera view above. You can create and view a short recording to see how your setup looks."
    }
}

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

whenPossibleToRecord

()

Observer that adds listener for play button once recorder is ready.

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

completedItemText

String

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:220

Text to show next to instructions checkboxes, if participant is required to check off each instruction (see requireItemConfirmation). Ignored if requireItemConfirmation is false.

Default: "Did it!"

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

instructionBlocks

Object

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:232

List of instruction segments to display to participant. Rendered using Exp-text-block, so all parameters of ExpTextBlock can be used.

Default: [set of standard instructions]

Sub-properties:

  • text String

    instructions text (can include html)

  • image Object

    image to display, with 'src' & 'alt' attributes

introText

String

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:153

Text to show as the introduction to the list of things to check. Can include HTML.

Default: ""

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

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.

recordingInstructionText

String

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:207

Text to show below the webcam view. For instance, you might instruct families to make a short recording in the position they will be in for the experiment, and make sure that the infant's eyes are visible or that the child is audible. HTML is allowed.

Default: "Did it!"

requireItemConfirmation

Boolean

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:174

Whether to show checkboxes under each instruction item and require participant to check them off to proceed.

Default: true

requireTestVideo

Boolean

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:185

Whether to require participant to make and view a test video. Ignored if showRecordMenu is false.

Default: true

showRecordMenu

Boolean

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:196

Whether to display record/replay menu to participant. If false, requireTestVideo value is ignored.

Default: true

showWaitForRecordingMessage

Boolean private

showWaitForUploadMessage

Boolean private

startRecordingAutomatically

Boolean private

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.

title

String

Specific to this element. Defined in app/components/exp-video-config-quality/component.js:164

Title to display to participant

Default: ""

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