Added Verenas function to have a preview image of the selected video file

This commit is contained in:
2025-11-17 15:02:22 +01:00
parent ada231cd28
commit f8fb71e146
4 changed files with 92 additions and 72 deletions
+11 -43
View File
@@ -1,13 +1,3 @@
//listener for the file explorer search
manualUploadBtn.addEventListener('click', () => {
try {
videoUpload.click();
} catch (error) {
console.log("Error in manualBtn EventListener click");
console.log(error);
}
});
//function to check if one checkbox is at least klicked
function checkBoxes() {
@@ -65,17 +55,6 @@ function changeLanguage(language) {
}
//listener for the file explorer search when something got selected
videoUpload.addEventListener('change', () => {
try {
handleFiles(videoUpload.files);
} catch (error) {
console.log("Error in manualBtn EventListener change");
console.log(error);
}
});
//function to display the file path in the drop down box
function handleFiles(files) {
try {
@@ -161,25 +140,14 @@ function deaktivateProgressbar(){
}
}
videoUpload.addEventListener("change", () => {
try {
activateSubmitBtn(videoUpload.files.length > 0);
} catch (error) {
console.log(error);
}
});
uploadContainer.addEventListener("drop", (e) => {
try {
e.preventDefault();
const file = e.dataTransfer.files[0];
if(file){
activateSubmitBtn(true);
}
} catch (error) {
console.log(error);
}
});
//Video thumbnail generation
function generateThumbnail(path){
const videoElement = document.getElementById("previewThumbnail");
while (videoElement.firstChild) videoElement.removeChild(videoElement.firstChild);
videoElement.src = path;
videoElement.type = "video/mov";
videoElement.load();
videoElement.style.maxWidth = 40;
videoElement.style.maxHeight = 40;
videoElement.autoplay = false;
}