Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
video.addEventListener('play', () => {
const loop = () => {
if (!video.paused && !video.ended) {
ctx.drawImage(video, 0, 0, 300, 170);
setTimeout(loop, 100); // Drawing at 10fps
}
};
loop();
});
const grayVideoTrack = canvas.captureStream(30).getVideoTracks()[0];
this.OV.initPublisher(
document.body,
{
audioSource: false,
videoSource: grayVideoTrack,
insertMode: VideoInsertMode.APPEND
});
})
.catch(error => {