XF 2.x YouTube Default Embed Size

Alan

cXF PREMIUM
Messages
28
Likes
12
#1
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
Messages
775
Likes
404
Website
www.customizexf.com
#9
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
Messages
28
Likes
12
#10
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