How to get the actual size of the video rendered in canvas, because I found that the size specified in renderVideo is not the actual rendered width and height

How to get the actual size of the video rendered in canvas, because I found that the size specified in renderVideo is not the actual rendered width and height

Hey @noobchen,

You can use the width and height attributes on the canvas element for ratio sizing and CSS to size the whole canvas.

Example:

<canvas id="canvas" width="1920" height="1080"></canvas>
canvas {
  width: 100%;
}

Let me know if that helps. :slight_smile:

Thanks,
Tommy

I mean to get the size of the video by any user in canvas

Because I need to get the actual size of the user video in the canvas to locate the position of the button in the outer html

Hey @noobchen

Thanks for your feedback.

Currently we don’t provide video actual size related API, the received aspect of video stream is 16/9, and the resolution depends on the network and performance.

We recommend you render the video at a ratio of 16/9.

Thanks
Vic