# Camera video input ratio issue on canvas render at mobile screen?

**URL:** <https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742>\
**Category:** Web\
**Tags:** video-sdk\
**Created:** [June 11, 2024, 4:06pm UTC](https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742 "2024-06-11T16:06:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinlabx](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kevinlabx](https://devforum.zoom.us/u/kevinlabx)\
**Post date:** [June 11, 2024, 4:06pm UTC](https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742/1 "2024-06-11T16:06:40Z")

</div>

Hi, is there any known issue on mobile for drawing render video on canvas regarding camera ratio or input?

I noticed that on both Android and iOS that when camera input was coming from phone it seems like it was breaking the render draw box in side canvas ending up leaking out side.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/3/632816e9fc207b1330906e4c92db23644f667805.jpeg)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/f/1f713107be3820cee5f1ad0563c90744a35ea935.jpeg)

Any input would be appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [June 12, 2024, 2:24am UTC](https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742/2 "2024-06-12T02:24:49Z")

</div>

Hey @kevinlabx

Thanks for your feedback.

This is usually due to coordinate calculation issues, where the coordinates on the canvas do not match the coordinates of the overlay DOM elements.

Can you try our sample app or use individual HTML elements to render the video?

> **[GitHub - zoom/videosdk-web-sample: Zoom Video SDK web sample](https://github.com/zoom/videosdk-web-sample/tree/master)**
>
> master

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![kevinlabx](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kevinlabx](https://devforum.zoom.us/u/kevinlabx)\
**Post date:** [June 12, 2024, 9:07pm UTC](https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742/3 "2024-06-12T21:07:04Z")

</div>

It seems like input width and height was correct but somehow render process is miscalculating on the smaller screen.

![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/7/0/7034057e4cc3fd33db97d0c13e3ec7b0d3cdacc3.png)

I end up using canvas because it was putting video in more efficient way in the maximized screen instead of HTML element and on the sample app it wasn’t properly using the screen space compare to canvas.

Is there known issue on Canvas? because input seems correct but it seems like it’s miscalculating on smaller screen and working fine on large screen.

@vic.yang

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [June 13, 2024, 2:48am UTC](https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742/4 "2024-06-13T02:48:03Z")

</div>

Hey @kevinlabx

In theory, there shouldn’t be any issues.

Could you please double-check that the canvas width and height are consistent with the video coordinates you’re calculating? Also, please ensure you are using `canvas.width` instead of `canvas.style.width`.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![kevinlabx](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kevinlabx](https://devforum.zoom.us/u/kevinlabx)\
**Post date:** [June 13, 2024, 3:49pm UTC](https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742/5 "2024-06-13T15:49:08Z")

</div>

@vic.yang Thank you. I think I found some clue on my internal code on calculation.  
I appreciate the help. I will keep you posted if I found otherwise.

Have a awesome day. 😆

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 14, 2024, 1:49am UTC](https://devforum.zoom.us/t/camera-video-input-ratio-issue-on-canvas-render-at-mobile-screen/111742/6 "2024-07-14T01:49:14Z")

</div>

Closed on July 14, 2024, 1:49am UTC

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