Session-record Class
These docs have moved here.Reference for DEVELOPERS of new frames only!
A mixin that can be used to add basic support for video recording to a particular experiment frame
You will also need to set sessionRecorderElement
if the recorder is to be housed other than
in an element identified by the ID sessionRecorder
.
The properties sessionRecorder
, sessionRecorderReady
, and
sessionVideoId
become available to the consuming frame. The recorder object has fields
that give information about its state: hasWebCam
, 'hasCamAccess,
recording,
connected, and
micChecked- for details, see services/video-recorder.js. These can be accessed from the consuming frame as e.g.
this.get('recorder').get('hasWebCam'). If starting recording, the function
onSessionRecordingStarted` will be called
once recording begins. If you want to do other things at this point, like proceeding
to a test trial, you can add this hook in your frame.
See 'methods' for the functions you can use on a frame that extends SessionRecord.
Events recorded in a frame that extends SessionRecord will automatically have additional
fields sessionVideoId (video filename), pipeId (temporary filename initially assigned by
the recording service),
and streamTime (when in the video they happened, in s).
Item Index
Methods
Methods
destroySessionRecorder
()
Destroy recorder and stop accessing webcam
onSessionRecordingStarted
()
Function called when session recording is started automatically. Override to do frame-specific actions at this point (e.g., beginning a test trial).
setupRecorder
-
element
Set up a video recorder instance
Parameters:
-
element
NodeA DOM node representing where to mount the recorder
Returns:
A promise representing the result of installing the recorder
startSessionRecorder
()
Start recording
Returns:
Promise Resolves when recording has started
stopSessionRecorder
()
Stop recording
Returns:
Promise Resolves when recording has been uploaded or timed out
whenPossibleToRecordSessionObserver
()
Observer that starts recording once session recorder is ready.
Properties
endSessionRecording
Number
Whether to end any session (multi-frame) recording at the end of this frame.
Default: false
sessionAudioOnly
Number
Whether to do audio-only (vs also video) recording for session (multiframe) recording. Only used if starting session recording this frame.
Default: 0
sessionMaxUploadSeconds
Number
Maximum time allowed for whole-session video upload before proceeding, in seconds. Can be overridden by researcher, based on tradeoff between making families wait and losing data.
Default: 10
startSessionRecording
Number
Whether to start a session (multi-frame) recording as soon as possible upon loading this frame. This allows you to conduct video recording across multiple frames, simply specifying which frame to start and end on. Individual frames may also provide frame-specific recording capabilities; it is best NOT to conduct both a multiframe 'session' recording and frame-specific recording simultaneously as multiple video streams will eat up bandwidth. If you decide to use session recording, turn off recording for any frames that would otherwise record. There can be multiple session recordings in an experiment, e.g. from frames 1-3 and 5-10.
Default: false
Events
sessionRecorderReady
When session video recorder has been installed
startSessionRecording
When session video recorder has begun recording
stoppingCapture
Just before stopping webcam video capture
stopSessionRecording
When session video recorder is stopped (upload may continue afterwards)
videoStreamConnection
When recorder detects a change in video stream connection status
Event Payload:
-
status
Stringstatus of video stream connection, e.g. 'NetConnection.Connect.Success' if successful