Added the check if a path is selected and the call to the transcript functio.

This commit is contained in:
2025-11-12 18:16:27 +01:00
parent a32e7e5744
commit 54f1f6c135
+21 -12
View File
@@ -25,21 +25,30 @@ manualBtn.addEventListener('click', () => {
//function to check if one checkbox is at least klicked //function to check if one checkbox is at least klicked
function checkBoxes() { function checkBoxes() {
const checkboxes = document.querySelectorAll('input[name="docFormat"]'); try {
let isChecked = false; const checkboxes = document.querySelectorAll('input[name="docFormat"]');
let isChecked = false;
checkboxes.forEach(function(checkbox){ checkboxes.forEach(function(checkbox){
if(checkbox.checked){ if(checkbox.checked){
isChecked = true; isChecked = true;
}
});
if(isChecked){
//Code to submit the video
var pathTest = fileName.textContent + "";
if(pathTest.endsWith(".mp4", ".mov", ".avi", ".mkv")){
mapFunctions.get("extraction-video-to-audio").function({inputVideoPath: pathTest, outputType:"wav"});
}
} else {
//language only english at the moment
alert('Please select at least one document type.');
} }
}); } catch (error) {
console.log("Error in scrpt.js checkBoxes function");
if(isChecked){
//Code to submit the video
} else {
//language only english at the moment
alert('Please select at least one document type.');
} }
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"}) // mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"})
} }