i have this simple script that i found in the webRTC doc i triet to run it but it seems i'm missing something
const leftVideo = document.getElementById('leftVideo');
const rightVideo = document.getElementById('rightVideo');
leftVideo.addEventListener('canplay', () => {
const stream = leftVideo.captureStream();
rightVideo.srcObject = stream;
});
i get this error on stream capture when i inspect it Uncaught DOMException: Failed to execute 'captureStream' on 'HTMLMediaElement': Cannot capture from element with cross-origin data at HTMLVideoElement.leftVideo.addEventListener this my index.html
<video id="leftVideo" playsinline controls loop muted>
<source src="test1.webm" type="video/webm"/>
<p>This browser does not support the video element.</p>
</video>
<video id="rightVideo" playsinline autoplay></video>