1. 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

Discussion in 'Troubleshooting and Problems' started by Mr Lucky, Sep 7, 2015.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    Does anyone know a way to speed up page loads in xenforo when a thread has multiple Youtube embeds?

    Thanks
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
  3. Mr Lucky

    Mr Lucky Well-Known Member

    AFAIK it is just the default xenforo settings.
     
  4. Mr Lucky

    Mr Lucky Well-Known Member

    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>
    Is there a way to find out?
     
  5. Kintaro

    Kintaro Well-Known Member

    try to add controls=2 to the youtube link in the embed code
     
    Zynektic and Ingenious like this.
  6. Ingenious

    Ingenious Well-Known Member

    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>
     
  7. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks for the suggestion but then I get this:

    Screen Shot 2015-09-07 at 14.26.52.png
     
  8. Ingenious

    Ingenious Well-Known Member

    Mr Lucky likes this.
  9. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks, I will test that one.
     
  10. Zynektic

    Zynektic Well-Known Member

    This worked like a charm for me, page and videos load instantly. Thanks!
     
    Ingenious likes this.
  11. Kintaro

    Kintaro Well-Known Member

    you're welcome! ;)
     
  12. Zynektic

    Zynektic Well-Known Member

    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
     
  13. W1zzard

    W1zzard Well-Known Member

  14. Rudy

    Rudy Well-Known Member

    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. ;)
     
    Jeremy likes this.
  15. Zynektic

    Zynektic Well-Known Member

    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.
     

Share This Page