# How to stretch video to fill video element

**URL:** <https://devforum.zoom.us/t/how-to-stretch-video-to-fill-video-element/17342>\
**Category:** Meeting SDK\
**Created:** [May 12, 2020, 11:10pm UTC](https://devforum.zoom.us/t/how-to-stretch-video-to-fill-video-element/17342 "2020-05-12T23:10:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bragma](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bragma/32/4213_2.png) [@bragma](https://devforum.zoom.us/u/bragma)\
**Post date:** [May 12, 2020, 11:10pm UTC](https://devforum.zoom.us/t/how-to-stretch-video-to-fill-video-element/17342/1 "2020-05-12T23:10:56Z")

</div>

Hi,  
I am using the SDK with customized UI. I’d like to eliminate “black bars” from the rendering of the video contained in a video element. Is there any option to stretch the content (preserving aspect) so that the video fills the smallest side of the video element?

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [May 19, 2020, 4:27am UTC](https://devforum.zoom.us/t/how-to-stretch-video-to-fill-video-element/17342/2 "2020-05-19T04:27:47Z")

</div>

Hi [bragma](https://devforum.zoom.us/u/bragma),

Thanks for the post. We do not have any interfaces to auto-fill the video element at the moment. You will need to handle the window messages and use the interface `SetPos` to modify the video size and its position.

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![bragma](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bragma/32/4213_2.png) [@bragma](https://devforum.zoom.us/u/bragma)\
**Post date:** [May 19, 2020, 8:38pm UTC](https://devforum.zoom.us/t/how-to-stretch-video-to-fill-video-element/17342/3 "2020-05-19T20:38:03Z")

</div>

Hi @carson.zoom,  
the problem is that since I don’t have information about the source aspect ratio, I cannot use the SetPos to set the video size correctly to remove bars. Moreover if I do it, I will cut away the user name which is overlayed by the sdk.

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [May 22, 2020, 6:55am UTC](https://devforum.zoom.us/t/how-to-stretch-video-to-fill-video-element/17342/4 "2020-05-22T06:55:19Z")

</div>

Hi @bragma,

Thanks for the reply. In Custom UI mode, the video aspect will be either 16:9 or 4:3, it depends on the user settings in Setting -\> Video; The corresponding interface is: `IVideoSettingContext.EnableAlwaysUse16v9()`. You may rely on this to get the aspect ratio.

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 9:29pm UTC](https://devforum.zoom.us/t/how-to-stretch-video-to-fill-video-element/17342/5 "2020-08-21T21:29:00Z")

</div>

Closed on August 21, 2020, 9:29pm UTC


