I am making an HTML/JS document, and I'll need a way to take a picture of the screen every frame and store it in an array, so that it's basically like a screen recording. But I'm having trouble knowing how to do this. What I was thinking was something like this:
var pictures = [];
setInterval(function() {
pictures.push(/**something here**/);
}, 1);
But I don't know what to put inside the setInterval
function in order for it to capture the screen and store it in the pictures
array. I've seen something to do with html2canvas
, but I don't know how to use that.