Previously I loaded video's by getting them with 'fs', this means they get loaded into the RAM. But I also bumped into another problem where the max video size was 2GB.
Now I'm trying to load them straight from the drive.
// Create a new video element
const videoElement = document.createElement("video");
// Set the video source
videoElement.src = "file:/" + videoPath;
videoElement.load();
In my regular Electron App with just javascript, this works fine.
But in Typescript I get the error:
"Refused to load media from 'file://users/jules/Documents/FuneralDesigner/AMPS_TEST/TEMP/VIDEO_1694202616957.mp4' because it violates the following Content Security Policy directive: "default-src 'self' 'unsafe-inline' data:". Note that 'media-src' was not explicitly set, so 'default-src' is used as a fallback."
I tried a lot but can't seem to solve it.
I also can't remake the project in a regular electron app because it's already in project and the project got quite big now.
What is usually the best way to load video's in a typescript + webpack electron app?
PS: "webSecurity: false" This is already set for other reasons.