Thanks for your reply, I am sending you pseudo code and screen shoot of canvas.
Still canvas is not showing video.
useEffect(() => {
const getRender = async () => {
if (mediaStream && videoRef.current && isVideoDecodeReady) {
if (activeVideo) {
/**
* Can not specify the width and height of the rendered video, also applied to the position of video.
* Passing these arguments just for consistency.
*/
await mediaStream?.renderVideo(
videoRef.current,
activeVideo,
canvasDimension.width,
canvasDimension.height,
0,
0,
VideoQuality.Video_90P,
);
} else if (activeVideo === 0 && previousActiveVideo) {
await mediaStream?.stopRenderVideo(
videoRef.current,
previousActiveVideo);
}
}
}
getRender();
}, [
mediaStream,
activeVideo,
previousActiveVideo,
isVideoDecodeReady,
canvasDimension,
videoRef,
videoRef.current,
]);