Martok
Well-known member
I would like to increase the size of embedded videos in XenForo 2.1. The current size of the likes of YouTube (560 x 315) seems to be a bit small, so I thought I'd change it to 800 x 450.
From what I can tell, the way you do this is to edit the relevant template in your style, in this case _media_site_embed_youtube. I did this and replaced
Checking one of the pages I have a video on, I noticed that the video still displayed at 560 x 315, not 800 x 600. Inspecting the code and I can see the change has happened:
However, further down I can see:
I then discovered that the template core_bbcode.less has the following code in it:
and it appears to control the width of the video. Changing width to 800 and the video then appears at the size I wanted. However changing it to any other size will then display videos in that size. Removing it altogether means the video sizes itself to the width of the post.
So it seems that that changing the _media_site_embed_youtube template has no effect, yet this is what I assumed it is there for, to alter media sites as desired, especially if you wanted videos from say YouTube, Twitch and Vimeo all displaying at different widths. Instead this is overridden by the code in core_bbcode.less.
Am I missing something here? Or is this a bug?
From what I can tell, the way you do this is to edit the relevant template in your style, in this case _media_site_embed_youtube. I did this and replaced
width="560" height="315"
with width="800" height="450"
then saved the template.Checking one of the pages I have a video on, I noticed that the video still displayed at 560 x 315, not 800 x 600. Inspecting the code and I can see the change has happened:
However, further down I can see:
I then discovered that the template core_bbcode.less has the following code in it:
Code:
.bbMediaWrapper,
.bbMediaJustifier
{
width: 560px;
max-width: 100%;
margin: 0;
and it appears to control the width of the video. Changing width to 800 and the video then appears at the size I wanted. However changing it to any other size will then display videos in that size. Removing it altogether means the video sizes itself to the width of the post.
So it seems that that changing the _media_site_embed_youtube template has no effect, yet this is what I assumed it is there for, to alter media sites as desired, especially if you wanted videos from say YouTube, Twitch and Vimeo all displaying at different widths. Instead this is overridden by the code in core_bbcode.less.
Am I missing something here? Or is this a bug?