MediaRecording template
Use the MediaRecording template to display a question with recording controls.
The audio and video are recorded by using the getUserMedia Web API.
You can use this template only if you use HTTPS to access the interviewing cluster, because the getUserMedia Web API is available only in secure contexts.
To specify whether audio and video are recorded and whether playback controls are displayed, see
uxui_template_name and uxui_template_props.
When you click the Record button, the microphone or camera are requested. If you have not allowed access to the devices, a permissions dialog appears. The Record button blinks during the recording. If you click Record again, it overwrites the previous recording. To stop the recording, click Stop or Next.
Audio fies are stored in mp3 format. Video files are stored in mp4 format. For information on the storage location and file naming, see
Respondent files.
For information about other audio and video properties that you can use, see
https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints.
Associated uxui_template_props
audio
true captures audio. Audio progress and audio playback controls are displayed. This value can also be set to an object that provides more constraints.
The default value is true.
video
true captures video. Video progress, and video playback controls are displayed. Voice is captured only if audio is also set to true.
This value can also be set to an object that provides more constraints.
The default value is false.
playback
true displays the playback controls. Existing media are loaded from the Respondent Files folder.
false hides the playback controls; the respondent cannot review or update their recording. Existing media is not loaded.
The default value is true.
Applies to
Text questions
Example
The following example records video:
q1 "Please answer with an audio or video recording."
[
uxui_template_name = "MediaRecording",
uxui_template_props = "{ video: true, playback: true }"
]
text;
The following example specifies the video width and height by using an object:
q2 "Please answer with an audio or video recording."
[
uxui_template_name = "MediaRecording",
uxui_template_props = "{ audio: true, video: { width: { ideal: 400 }, height: { ideal: 300 } } }" ]
text;
See