# Custom aspect ratio and background color with attachVideo()

**URL:** <https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013>\
**Category:** Video SDK\
**Tags:** video-sdk\
**Created:** [March 19, 2024, 12:36am UTC](https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013 "2024-03-19T00:36:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shi88.andy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shi88.andy/32/55545_2.png) [@shi88.andy](https://devforum.zoom.us/u/shi88.andy)\
**Post date:** [March 19, 2024, 12:36am UTC](https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013/1 "2024-03-19T00:36:36Z")

</div>

I’m able to render participant video to the video-player element with the attachVideo() method, but got some minor issues that’s not alignin to our app:

- it renders to 16:9 ratio.
- it adds dark background to the video-player-container

a. Is it possible to customize width and the height of it?

b. Is it possible to make the video-player-background to transparent instead?

c. we are moving to this approach because we’re hit with the too many webGL context limitation, can you confirm if this approach will resolve that issue?

---

<div class="post-metadata">

**Author:** ![shi88.andy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shi88.andy/32/55545_2.png) [@shi88.andy](https://devforum.zoom.us/u/shi88.andy)\
**Post date:** [March 19, 2024, 2:13am UTC](https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013/2 "2024-03-19T02:13:38Z")

</div>

I was able to solve `a` by modifying the `startVideo` width and height from the video-sender.

still need help for `b` and `c` 🙂

---

<div class="post-metadata">

**Author:** ![shi88.andy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shi88.andy/32/55545_2.png) [@shi88.andy](https://devforum.zoom.us/u/shi88.andy)\
**Post date:** [March 19, 2024, 8:54am UTC](https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013/3 "2024-03-19T08:54:25Z")

</div>

we’ve just also confirmed c  
it does solve the `too many webGL context` issue

just b now 🙂

---

<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:** [March 20, 2024, 7:47am UTC](https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013/4 "2024-03-20T07:47:47Z")

</div>

Hey @shi88.andy

> Is it possible to make the video-player-container to transparent instead?

It’s transparent by default. The shadow dom of the video-player-container only includes a canvas, which is transparent by default.

Can you share some code snippets with us for troubleshooting?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![shi88.andy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shi88.andy/32/55545_2.png) [@shi88.andy](https://devforum.zoom.us/u/shi88.andy)\
**Post date:** [March 20, 2024, 10:03am UTC](https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013/5 "2024-03-20T10:03:13Z")

</div>

sorry forgot to update this, it was our other component that’s making it dark, it’s transparent. thanks

---

<div class="post-metadata">

**Author:** ![ekaansh.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ekaansh.zoom/32/55004_2.png) [@ekaansh.zoom](https://devforum.zoom.us/u/ekaansh.zoom)\
**Post date:** [March 21, 2024, 2:46pm UTC](https://devforum.zoom.us/t/custom-aspect-ratio-and-background-color-with-attachvideo/106013/6 "2024-03-21T14:46:53Z")

</div>

Closed on March 21, 2024, 2:46pm UTC


