Autoplay in embedded Youtube video makes width shrink

I am trying to have an embedded Youtube video play automatically on one of my homepages, and I want it playing at full width. When the video has not got the autoplay option enabled in the URL the video is at full width. As soon as I insert the autoplay option a the end of the video URL, it autoplays OK but the width shrinks and I can’t get it back to full width again. As soon as I remove the autoplay from the embedded code it goes back to full width.
Thanks
Mark

Hey Mark,

Welcome to the BB forums! :slight_smile:

How are you embedding the video? Is it via our Video Module? This may be a problem with how Youtube embeds work. Do you mind sharing the embed codes, both with the autoplay and full wdith so we can try it on our end?

Ben

Hi Ben

I was using the HTML advanced module and the code was:

<iframe width=“100%” height=“315” src=“https://www.youtube.com/embed/E7wS_9GXZPE?autoplay=1” frameborder=“0” allowfullscreen></iframe>

If I take out the ?autoplay=1 part it goes to full screen width.

After I got your reply I tried the Video module and it seems to be fine with that. Not sure why it wasn’t working in the HTML on e though.

Mark

Hey Mark,

It actually doesn’t work even if you remove that autoplay part from the URL. You do see the video is full width at the start but when you play it, it shrinks. This is caused by the height property you have placed on the iframe. The video adjusts its aspect ratio rather than showing you a cropped/stretched one. It works fine on our video module since it disregards those properties. Hope this makes sense.

Ben