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

XF 1.2 Slow page loading on threads with many videos

Discussion in 'XenForo Questions and Support' started by jauburn, Dec 13, 2013.

  1. jauburn

    jauburn Well-Known Member

  2. Chris D

    Chris D XenForo Developer Staff Member

    The slowness here stems from (in this case) YouTube which is serving up a lot of content as a result of embedded videos.

    There is something that can improve performance.

    By default, the BB Code Media Site HTML serves Flash for YouTube videos. You may see some improvement if you switch this to YouTube's HTML 5 player. In this case it tries HTML 5 first, and if the browser is not HTML 5 capable, I believe it degrades back to using Flash.

    So in Admin CP > BB Code Media Sites > YouTube

    Change Embed HTML to:

    <iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&html5=1" frameborder="0" allowfullscreen></iframe>
  3. jauburn

    jauburn Well-Known Member

    I tried that. Thanks. I'm not sure it improved page load speed at all, though. Subjectively, it's the same.
  4. Chris D

    Chris D XenForo Developer Staff Member

    I dunno. It seems a little less sluggish.

    When I first tried it, the page kept freezing as I scrolled down.

    Since you made the change it seems less-so.

    But aside from that, there's not a lot we can do. XenForo isn't doing anything at this point. It's just loading its own content. The HTML is already embedded and so it's your browser that goes off to YouTube to fetch the videos and the video player. So the factors involved are your browser, your connection to the internet and the response times from Google.
    jauburn and Adam Howard like this.
  5. Adam Howard

    Adam Howard Well-Known Member

    @Mike this improved page load speed up dramatically for me. Can we please make this the default in XenForo 1.3 ?
    jauburn likes this.
  6. Chris D

    Chris D XenForo Developer Staff Member

    I think @Mike has stated elsewhere that changing BB Code Media Sites is tricky because they are customisable without any sort of version control. Many people have altered their default embed code. Some may have put wrappers around the videos, changed the settings of them etc.

    So it's unlikely it will change for upgrades. Though, of course, it could be updated for new installs.

    But I would support a suggestion for the system being improved somewhat so it had some sort of version awareness. @Kier or @Mike might one day consider something whereby you have a master embed code, and that can be updated across XenForo versions without immediately deleting any customisations. Maybe a very simple auto-merge would inspect the old master with the current value and if they match, the new updated value can overwrite that, alternatively mark it as outdated and leave it to the Admin to decide which version they want to keep.

    Should be quite a simple change.

    There are people out there who still use the old embed code which I believe may have shipped with XenForo 1.0. The one based on <object> tags. I guess there's never a guarantee as to how long that will work reliably for. YouTube still offer it as an option, but that doesn't meant to say they always will.

    EDIT: Just found a bit of a show stopper. The HTML 5 player does not gracefully fallback to the flash based player, as I thought it did.

    This means that a change like this would affect XenForo's reported compatibility with Internet Explorer 8.


    Might be something we see in XenForo 2.0 perhaps.
    Adam Howard likes this.
  7. Adam Howard

    Adam Howard Well-Known Member

    @Chris Deeming you wouldn't know any of the other media codes I could tweak to use html5 would you? :D
  8. Chris D

    Chris D XenForo Developer Staff Member

    Not off the top of my head.

    You may want to read my edit. If you're bothered about Internet Explorer compatibility you may want to stick to your existing code.
  9. Adam Howard

    Adam Howard Well-Known Member

    Internet Explorer should be used for only 1 thing.... To download a real / better browser.
  10. Mike

    Mike XenForo Developer Staff Member

    The iframe has been used for all default embed codes for some time -- some since 1.1, some since 1.2. Some cases can be updated automatically (particularly when the old code no longer works).
  11. darren

    darren Member

    Is there anyway of limiting a video to 1 video per post? I'm hoping that will speed things up for me.
  12. Brogan

    Brogan XenForo Moderator Staff Member

    ACP Search: embeds
    Bram and darren like this.
  13. Valter

    Valter Active Member

    Last edited: Jan 8, 2014
  14. Kintaro

    Kintaro Well-Known Member

  15. jauburn

    jauburn Well-Known Member

  16. Kintaro

    Kintaro Well-Known Member

    I don't know.
  17. jauburn

    jauburn Well-Known Member

    When you first post a video with this plugin installed, you get a cross-hatched grayscale rectangle. Why is that?

Share This Page