mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 03:00:54 +00:00
add width and height options for mirror plugin
This commit is contained in:
parent
cade6b7f9e
commit
d699a83f11
@ -16,7 +16,8 @@
|
||||
}
|
||||
|
||||
const mirror_camera = {
|
||||
type: jsPsychMirrorCamera
|
||||
type: jsPsychMirrorCamera,
|
||||
width: 320,
|
||||
}
|
||||
|
||||
jsPsych.run([init_camera, mirror_camera]);
|
||||
|
@ -8,6 +8,16 @@ const info = <const>{
|
||||
type: ParameterType.STRING,
|
||||
default: "Continue",
|
||||
},
|
||||
/** Height of the video element */
|
||||
height: {
|
||||
type: ParameterType.INT,
|
||||
default: null,
|
||||
},
|
||||
/** Width of the video element */
|
||||
width: {
|
||||
type: ParameterType.INT,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -33,7 +43,9 @@ class MirrorCameraPlugin implements JsPsychPlugin<Info> {
|
||||
this.stream = this.jsPsych.pluginAPI.getCameraStream();
|
||||
|
||||
display_element.innerHTML = `
|
||||
<video autoplay playsinline id="jspsych-mirror-camera-video" style=""></video>
|
||||
<video autoplay playsinline id="jspsych-mirror-camera-video" width="${
|
||||
trial.width ? trial.width : "auto"
|
||||
}" height="${trial.height ? trial.height : "auto"}"></video>
|
||||
<p><button class="jspsych-btn" id="btn-continue">${trial.button_label}</button></p>
|
||||
`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user