typo fixed

This commit is contained in:
Jan 2024-08-07 13:56:15 +02:00
parent 63ffaf02a6
commit dfb37e4a86
2 changed files with 6 additions and 8 deletions

View File

@ -7,7 +7,6 @@ const buttonDeleteIcon = document.getElementById('buttonDeleteIcon');
const videoDisplay = document.getElementById('videoDisplay'); const videoDisplay = document.getElementById('videoDisplay');
const videoContainer = document.getElementById('videoContainer'); // div that contains the videodisplay const videoContainer = document.getElementById('videoContainer'); // div that contains the videodisplay
const videoContainerCss = document.querySelector('.video-container') //might be unnecessary
var mediaRecorder = null; // interface of the Media Stream Recording API to record the video stream var mediaRecorder = null; // interface of the Media Stream Recording API to record the video stream
var stream = null; // webcam video input stream var stream = null; // webcam video input stream
@ -16,7 +15,7 @@ let isRecording = false; // false to display record button, true to display s
let videoAccess = false; // true if user has given permission to use the webcam let videoAccess = false; // true if user has given permission to use the webcam
// default video dimensions // default video dimensions
let videoHeigt = 720; let videoHeight = 720;
let videoWidth = 1280; let videoWidth = 1280;
// handle form submission // handle form submission
@ -79,22 +78,22 @@ async function cameraButton() {
videoAccess = true; videoAccess = true;
// set the dimensions of the webcam stream to the video display // set the dimensions of the webcam stream to the video display
videoHeigt = stream.getVideoTracks()[0].getSettings().height videoHeight = stream.getVideoTracks()[0].getSettings().height
videoWidth = stream.getVideoTracks()[0].getSettings().width videoWidth = stream.getVideoTracks()[0].getSettings().width
// calculate the aspec ratio // calculate the aspec ratio
let aspectratio = (videoHeigt / videoWidth) *100 let aspectratio = (videoHeight / videoWidth) *100;
//console.log("videoHeigt: ",videoHeigt); //console.log("videoHeight: ",videoHeight);
//console.log("videoWidth: ",videoWidth); //console.log("videoWidth: ",videoWidth);
//console.log("aspect ratio: ",aspectratio); //console.log("aspect ratio: ",aspectratio);
//console.log("device: ",stream.getVideoTracks()[0].getSettings().deviceId); //console.log("device: ",stream.getVideoTracks()[0].getSettings().deviceId);
// adjust CSS to make the video fit properly // adjust CSS to make the video fit properly
// this makes sure that there is no buggy "jumping" when the video display source changes // this makes sure that there is no buggy "jumping" when the video display source changes
videoContainer.style.setProperty("padding-bottom", "min("+videoHeigt+"px,"+aspectratio+"%)"); videoContainer.style.setProperty("padding-bottom", "min("+videoHeight+"px,"+aspectratio+"%)");
// adjust the max width for horizontal and vertical video input // adjust the max width for horizontal and vertical video input
if (videoHeigt > videoWidth){ //hochkant video if (videoHeight > videoWidth){ //hochkant video
videoContainer.style.setProperty("max-width", "min(80%,576"); videoContainer.style.setProperty("max-width", "min(80%,576");
}else{ //normal, horizontal }else{ //normal, horizontal
videoContainer.style.setProperty("max-width", "100%"); videoContainer.style.setProperty("max-width", "100%");

View File

@ -225,7 +225,6 @@ step={{question["step"]}}
</div> </div>
<script src="{{ url_for('static', filename='videoscript.js')}}"> <script src="{{ url_for('static', filename='videoscript.js')}}">
</script> </script>
{% else %} {% else %}
<p>Error: Block {{config["question 1"]["blocks"][block]["type"]}} could not be loaded!</p> <p>Error: Block {{config["question 1"]["blocks"][block]["type"]}} could not be loaded!</p>