new Camera(options)
- Source:
- To Do:
- 
        - add video constraints as parameter
 
This manager handles the recording of video signal.
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| options | Object | Properties
 | 
Methods
(protected) _onChange()
- Source:
Callback for changes to the recording settings.
Changes to the settings require the recording to stop and be re-started.
(protected) _prepareRecording()
- Source:
Prepare the recording.
(protected) _upload(tag, waitForCompletionopt, showDialogopt, dialogMsgopt)
- Source:
Upload the video recording to the pavlovia server.
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
| tag | string | an optional tag for the video file | ||
| waitForCompletion | boolean | <optional> | false | whether to wait for completion before returning | 
| showDialog | boolean | <optional> | false | whether to open a dialog box to inform the participant to wait for the data to be uploaded to the server | 
| dialogMsg | string | <optional> | "" | default message informing the participant to wait for the data to be uploaded to the server | 
authorize(showDialogopt, dialogMsgopt) → {boolean}
- Source:
Prompt the user for permission to use the camera on their device.
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
| showDialog | boolean | <optional> | false | whether to open a dialog box to inform the participant to wait for the camera to be initialised | 
| dialogMsg | string | <optional> | the dialog message | 
Returns:
whether or not the camera is ready to record
- Type
- boolean
close() → {Promise.<void>}
- Source:
Close the camera stream.
Returns:
promise fulfilled when the stream has stopped and is now closed
- Type
- Promise.<void>
flush() → {Promise}
- Source:
Submit a request to flush the recording.
Returns:
promise fulfilled when the data has actually been made available
- Type
- Promise
getRecording(tag, flushopt)
- Source:
Get the current video recording as a VideoClip in the given format.
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
| tag | string | an optional tag for the video clip | ||
| flush | boolean | <optional> | false | whether or not to first flush the recording | 
getStream() → {MediaStream}
- Source:
Get the underlying video stream.
Returns:
the video stream
- Type
- MediaStream
getVideo() → {HTMLVideoElement}
- Source:
Get a video element pointing to the Camera stream.
Returns:
a video element
- Type
- HTMLVideoElement
isReady() → {boolean}
- Source:
Query whether the camera is ready to record.
Returns:
true if the camera is ready to record, false otherwise
- Type
- boolean
open()
- Source:
Open the video stream.
pause() → {Promise}
- Source:
Submit a request to pause the recording.
Returns:
promise fulfilled when the recording actually paused
- Type
- Promise
record() → {Promise}
- Source:
Submit a request to start the recording.
Returns:
promise fulfilled when the recording actually starts
- Type
- Promise
resume(options) → {Promise}
- Source:
Submit a request to resume the recording.
resume has no effect if the recording was not previously paused.
Parameters:
| Name | Type | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| options | Object | Properties
 | 
Returns:
promise fulfilled when the recording actually resumed
- Type
- Promise
stop(options) → {Promise}
- Source:
Submit a request to stop the recording.
Parameters:
| Name | Type | Description | 
|---|---|---|
| options | Object | 
Returns:
promise fulfilled when the recording actually stopped, and the recorded data was made available
- Type
- Promise