XF 2.0 How to make YouTube embed responsive?

Mackeral_Fillet

Well-known member
Right now its the default and I have this information mark at the top of the AdminCP options. I'd like the YouTube embed to fill the available width. Cant work out to do it, can anyone help me?

Thanks,
Rob.

Screen Shot 2018-04-07 at 17.05.28.webp

Code:
<div class="bbMediaWrapper">
    <div class="bbMediaWrapper-inner">
        <iframe src="https://www.youtube.com/embed/{$id}?wmode=opaque&start={$start}"
                width="560" height="315"
                frameborder="0" allowfullscreen="true"></iframe>
    </div>
</div>
 
I don't know how to target just youtube bbcode, but this one would do the job for all embeds:

CSS:
.bbMediaWrapper,
.bbMediaJustifier {
    width: auto;
}

I tried editing width and height in youtube embed template, but that didn't work. Your code worked. Thanks!
 
Top Bottom