Canvas window full width and height

I try to render canvas with full window width and height. I calculate window width and height and put them in renderVideo and canvas element. Video takes all window height but not window width. Video is square.

await mediaStream.renderVideo(videoRef.current, userId, width, height,0,0,3);

<canvas
   width={width}
   height={height}
   ref={videoRefRef} />
1 Like

Hey @reactdev

Thanks for your feedback.

The aspect ratio is 16:9 as default, so if the canvasWidth / canvasHeight is not as this ratio, there are blank spaces around the video.

Thanks
Vic

Is there way to change aspect ration?

Hi @reactdev

Sorry there is no method to change the aspect ratio.

Thanks
Vic

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.