# record-video This extension records video from the participant's webcam during a trial. This extension encodes the video data in [base 64 format](https://developer.mozilla.org/en-US/docs/Glossary/Base64). This is a text-based representation of the video which can be coverted to various video formats using a variety of [online tools](https://www.google.com/search?q=base64+video+decoder) as well as in languages like python and R. ## Parameters ### Initialization Parameters Initialization parameters can be set when calling `initJsPsych()` ```js initJsPsych({ extensions: [ {type: jsPsychExtensionRecordVideo, params: {...}} ] }) ``` Parameter | Type | Default Value | Description ----------|------|---------------|------------ *None* ### Trial Parameters Trial parameters can be set when adding the extension to a trial object. ```js var trial = { type: jsPsych..., extensions: [ {type: jsPsychExtensionRecordVideo, params: {...}} ] } ``` Parameter | Type | Default Value | Description ----------|------|---------------|------------ *None* ## Data Generated Name | Type | Value -----|------|------ record_video_data | base64 string | [Base 64 encoded](https://developer.mozilla.org/en-US/docs/Glossary/Base64) representation of the video data. ## Examples ???+ example "Record video data during a trial" === "Code" ```javascript const init_camera = { type: jsPsychInitializeCamera }; const trial = { type: jsPsychHtmlButtonResponse, stimulus: `
Video is recording. Click done after a few seconds.
", extensions: [ {type: jsPsychExtensionRecordVideo} ] }; ``` === "Demo"