# Canvas window full width and height

**URL:** <https://devforum.zoom.us/t/canvas-window-full-width-and-height/62550>\
**Category:** Web\
**Created:** [January 12, 2022, 11:42am UTC](https://devforum.zoom.us/t/canvas-window-full-width-and-height/62550 "2022-01-12T11:42:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![reactdev](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@reactdev](https://devforum.zoom.us/u/reactdev)\
**Post date:** [January 12, 2022, 11:42am UTC](https://devforum.zoom.us/t/canvas-window-full-width-and-height/62550/1 "2022-01-12T11:42:48Z")

</div>

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.

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

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

```

---

<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:** [January 13, 2022, 2:50am UTC](https://devforum.zoom.us/t/canvas-window-full-width-and-height/62550/2 "2022-01-13T02:50:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![reactdev](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@reactdev](https://devforum.zoom.us/u/reactdev)\
**Post date:** [January 13, 2022, 9:29am UTC](https://devforum.zoom.us/t/canvas-window-full-width-and-height/62550/3 "2022-01-13T09:29:30Z")

</div>

Is there way to change aspect ration?

---

<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:** [January 14, 2022, 2:25am UTC](https://devforum.zoom.us/t/canvas-window-full-width-and-height/62550/4 "2022-01-14T02:25:17Z")

</div>

Hi @reactdev

Sorry there is no method to change the aspect ratio.

Thanks  
Vic

---

<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:** [February 13, 2022, 12:25pm UTC](https://devforum.zoom.us/t/canvas-window-full-width-and-height/62550/5 "2022-02-13T12:25:36Z")

</div>

Closed on February 13, 2022, 12:25pm UTC

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