XF 2.0 YouTube Default Embed Size

Currently reading:
XF 2.0 YouTube Default Embed Size

Alan

cXF PREMIUM
Aug 23, 2018
36
13
Hello BassMan,
I am trying to change the default embed size of YouTube videos as I think 560x315 is a little small. I tried editing the template

_media_site_embed_youtube

to 800x600 but nothing at all happens. Is there somewhere else I need to edit to get the videos bigger by default?
Below is a copy of that template, as you can see the only thing I changed was the Width and Height

<div class="bbMediaWrapper">
<div class="bbMediaWrapper-inner">
<iframe src="YouTube{$id}?wmode=opaque&start={$start}"
width="800" height="600"
frameborder="0" allowfullscreen="true"></iframe>
</div>
</div>


Many thanks for your time

Alan
 

BassMan

Staff member
Administrator
May 18, 2015
1,104
686
www.customizexf.com
BUT!

As you would see you can't edit this item, so you'll need to create new BB code for Youtube to change the size. Copy/paste fields and change the value for size.
 

Alan

cXF PREMIUM
Aug 23, 2018
36
13
Errr, could you give me a few pointers mate? I am not entirly sure where to paste them.
 
Last edited:

BassMan

Staff member
Administrator
May 18, 2015
1,104
686
www.customizexf.com
Go to:

ACP > Content > BB Code media sites.

Then disable current YouTube BB code.
1541964980500.png


After that click here:
1541965014800.png


Fill the form:
Media site id: youtube_custom

Site title: YouTube

Site URL: https://www.youtube.com

Match URLs:
Code:
youtube.com/watch?v={$id}
youtube.com/watch?*&v={$id}
youtube.com/v/{$id}
youtu.be/{$id}
youtube.com/*/u/*/{$id}
youtube.com/embed/{$id}
Embed template:
HTML:
<div class="bbMediaWrapper">
    <div class="bbMediaWrapper-inner">
        <iframe src="https://www.youtube.com/embed/{$id}?wmode=opaque&start={$start}"
                width="800" height="600"
                frameborder="0" allowfullscreen="true"></iframe>
    </div>
</div>

Then open Advanced options tab in the same form:

URL match callback: XF\BbCode\Helper\YouTube :: matchCallback

Embed HTML callback : XF\BbCode\Helper\YouTube :: htmlCallback

Hit Save and exit.


I think this should work.
 

Alan

cXF PREMIUM
Aug 23, 2018
36
13
That didnt work for me, it made all the embedded youtube videos disappear. There are just too many for me to get new links and repost them but thanks for all your help.

Alan
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Top