I have to take screenshot of a streaming video, the source of videos are twist.moe. But when I execute my code with the 'canvas.toDataURL('image/png')', I got error of tainted canvas.
setTimeout(() => {
let video = document.querySelector('video').cloneNode(true);
video.currentTime = 23;
video.volume = 0;
video.onloadeddata = () => {
let canvas = document.createElement('canvas');
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.crossOrigin = "Use-Credentials";
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
document.body.append(canvas);
document.body.append(canvas.toDataURL('image/png'));
};
}, 1000);