mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
fixed the code so that it now returns the actual path of the file
This commit is contained in:
@@ -9,6 +9,9 @@ try {
|
|||||||
contextBridge.exposeInMainWorld("extractor", {
|
contextBridge.exposeInMainWorld("extractor", {
|
||||||
extract: (file) => ipcRenderer.send("extract", file)
|
extract: (file) => ipcRenderer.send("extract", file)
|
||||||
})
|
})
|
||||||
|
contextBridge.exposeInMainWorld("electronAPI", {
|
||||||
|
getFilePath: (file) => {return webUtils.getPathForFile(file)}
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in preload.js");
|
console.log("Error in preload.js");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function checkBoxes() {
|
|||||||
|
|
||||||
if(isChecked){
|
if(isChecked){
|
||||||
//Code to submit the video
|
//Code to submit the video
|
||||||
var pathTest = fileName.textContent + "";
|
var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]);
|
||||||
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")){
|
||||||
window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"})
|
window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"})
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ function checkBoxes() {
|
|||||||
alert('Please select at least one document type.');
|
alert('Please select at least one document type.');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error")
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"})
|
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"})
|
||||||
|
|||||||
Reference in New Issue
Block a user