'canvas media capture does not show up on video

I am trying to have two elements a canvas element and a video element I want the canvas element to stream to the video element but the video juts shows up empty

this is the code for the stream

function startStream() {
    let stream = canvasElement.captureStream(15);
    videoElement.srcObject = stream;
}

I checked in dev console and all the elements are properly defined, also the srcObject of the video element is being set to the stream, any ideas what I could have done wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source