mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Implemented functionality to have the UI be able to communicate with the backend
This commit is contained in:
@@ -5,7 +5,10 @@ const { contextBridge, ipcRenderer, webUtils } = require('electron')
|
|||||||
try {
|
try {
|
||||||
contextBridge.exposeInMainWorld("explorer", {
|
contextBridge.exposeInMainWorld("explorer", {
|
||||||
onFileDrop: (file) => webUtils.getPathForFile(file)
|
onFileDrop: (file) => webUtils.getPathForFile(file)
|
||||||
})
|
})
|
||||||
|
contextBridge.exposeInMainWorld("extractor", {
|
||||||
|
extract: (file) => ipcRenderer.send("extract", file)
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in preload.js");
|
console.log("Error in preload.js");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ manualUploadBtn.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() {
|
||||||
|
console.log("fuck");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const checkboxes = document.querySelectorAll('input[name="docFormat"]');
|
const checkboxes = document.querySelectorAll('input[name="docFormat"]');
|
||||||
let isChecked = false;
|
let isChecked = false;
|
||||||
@@ -25,7 +27,8 @@ function checkBoxes() {
|
|||||||
//Code to submit the video
|
//Code to submit the video
|
||||||
var pathTest = fileName.textContent + "";
|
var pathTest = fileName.textContent + "";
|
||||||
if(pathTest.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
if(pathTest.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
||||||
mapFunctions.get("extraction-video-to-audio").function({inputVideoPath: pathTest, outputType:"wav"});
|
console.log("fuck 2");
|
||||||
|
window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//language only english at the moment
|
//language only english at the moment
|
||||||
|
|||||||
Reference in New Issue
Block a user