mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Added Verenas function to have a preview image of the selected video file
This commit is contained in:
+11
-43
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user