hey, I have a video.mp4 on my computer and I want to load it to a p5 sketch. this is the code:
let pause_vid = true;
function preload() {
vid = createVideo("video.mp4");
}
function setup() {
createCanvas(window.innerWidth, window.innerHeight);
vid.size(width, height);
vid.volume(0);
vid.hide(); // hides the html video loader
vid.pause();
}
function draw() {
image(vid,0,0,width,height);
}
function mousePressed() {
if (!pause_vid) {
vid.pause();
} else {
vid.loop();
}
pause_vid = !pause_vid
}
everything is working fine, the problem is that the quality of the video in the browser is very low. (the original video is of good quality).
what can I do?
thanks