# The Video module not picking up correct width and height.

**URL:** <https://community.hubspot.com/t/the-video-module-not-picking-up-correct-width-and-height/107675>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [May 21, 2024, 6:51pm UTC](https://community.hubspot.com/t/the-video-module-not-picking-up-correct-width-and-height/107675 "2024-05-21T18:51:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FurqanAli](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/furqanali/32/8909_2.png) [@FurqanAli](https://community.hubspot.com/u/FurqanAli)\
**Post date:** [May 21, 2024, 6:51pm UTC](https://community.hubspot.com/t/the-video-module-not-picking-up-correct-width-and-height/107675/1 "2024-05-21T18:51:03Z")

</div>

Hi there,  
I’m facing one issue I’m using video player field in my custom module but it is not picking up if we are specifying custom width and height. Please check the code:

\<div class=“main\_video\_box” id=“full\_width\_v4” style=“{{ module.style.backgroundimage\_field.css }}; background-color:{{ module.style.background\_color.css}}; {{ module.style.spacing\_field.css }}”\>  
\<div class=“container” style=“”\>  
\<div class=“main\_video” \>  
\<h4 class=“text text–2 text–bold”\>  
{{ module.sub\_text }}  
\</h4\>  
\<h3 class=“text text–61 text–bold” style=“font-family: PublicoHeadline-Roman,Georgia,serif;”\>  
{{ module.main\_heading\_text }}  
\</h3\>  
{% if module.embed\_code\_ == ‘embed’ %}  
{{ module.embed\_code\_ }}  
{% else %}  
{% if module.videoplayer\_field.player\_id %}  
{% set max\_width = module.videoplayer\_field.size\_type == ‘auto\_custom\_max’ ? module.videoplayer\_field.max\_width : module.videoplayer\_field.width %}  
{% set max\_height = module.videoplayer\_field.size\_type == ‘auto\_custom\_max’ ? module.videoplayer\_field.max\_height : module.videoplayer\_field.height %}  
\<div class=“test\_video” style=“max-width: {{ max\_width }}px; max-height: {{ max\_height }}px;margin:0px auto;”\>  
{% video\_player “embed\_player”  
player\_id={{ module.videoplayer\_field.player\_id }}  
type={{ module.videoplayer\_field.player\_type || ‘scriptV4’ }}  
full\_width={{ module.videoplayer\_field.size\_type == ‘auto\_full\_width’ }},  
conversion\_asset={{ module.videoplayer\_field.conversion\_asset|tojson|safe }}  
autoplay={{ module.videoplayer\_field.autoplay }}  
hidden\_controls={{ module.videoplayer\_field.hide\_controls }}  
loop={{ module.videoplayer\_field.loop\_video }}  
muted={{ module.videoplayer\_field.mute\_by\_default }}  
%}  
\</div\>  
{% endif %}  
{% endif %}

\</div\>  
\</div\>  
\</div\>  
Also, note that I’m using a radio box to provide the option to the user to select either embed code or video from HubSpot.  
Thanks a lot for the help.

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [May 22, 2024, 4:10pm UTC](https://community.hubspot.com/t/the-video-module-not-picking-up-correct-width-and-height/107675/2 "2024-05-22T16:10:08Z")

</div>

Hi @FurqanAli

I have also encountered this same issue while using the video field. The maximum height & width field in the video doesn’t work. I select the video’s iframe and use a number field for the same and it works for me.

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!
