• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Page speed when thread has multiple Youtube embeds

Chris D

XenForo developer
Staff member
#2
I can't remember what it is called, but I believe there is an add-on in the Resource Manager that defers the loading of YouTube embeds until they are clicked. That is one solution.

It's worth checking what your embed code is for YouTube. If you're using the old style <object> embed code rather than the new style <iframe> embed code, then I recall this may have performance issues.

It may also be dependent on whether you are being served the flash player or their newer HTML5 player. The latter will have better performance in newer browsers.
 

Mr Lucky

Well-known member
#3
It's worth checking what your embed code is for YouTube. If you're using the old style <object> embed code rather than the new style <iframe> embed code, then I recall this may have performance issues.

It may also be dependent on whether you are being served the flash player or their newer HTML5 player. The latter will have better performance in newer browsers.
AFAIK it is just the default xenforo settings.
 

Mr Lucky

Well-known member
#4
Hi Chris

This is what I have for Youtube embeds, I presume that is the new style you mention

Code:
<iframe width="500" height="300" src="https://www.youtube.com/embed/{$id}?wmode=opaque" frameborder="0" allowfullscreen></iframe>
It may also be dependent on whether you are being served the flash player or their newer HTML5 player. The latter will have better performance in newer browsers.
Is there a way to find out?
 

Zynektic

Well-known member
#10
This is what I have. I have whole threads stuffed with YouTube embeds and the pages are fine. I also add a <p> tag to force them onto new lines, keeps it tidier.

Code:
<p><iframe width="500" height="300" src="https://www.youtube.com/embed/{$id}?wmode=opaque&controls=2" frameborder="0" allowfullscreen></iframe></p>
This worked like a charm for me, page and videos load instantly. Thanks!
 

Zynektic

Well-known member
#12
Setting up a new forum again, been awhile but without using the addon is it still okay to use this or has anything changed since?

Code:
<p><iframe width="500" height="300" src="https://www.youtube.com/embed/{$id}?wmode=opaque&controls=2" frameborder="0" allowfullscreen></iframe></p>
Cheers
 

Rudy

Well-known member
#14
try to add controls=2 to the youtube link in the embed code
We did that several months ago, and it made the forum much faster. Especially for visitors on ancient computers and operating systems. The idea is that adding "&controls=2" keeps the embedded YouTube from preloading content. I would not even bother with an add-on: just edit what's there. I have @Jeremy to thank for this tip. ;)
 

Zynektic

Well-known member
#15
Yeah I added that on my old forum but closed the site in November and wondered if anything had changed since with how it was done, cheers.