Implemented YouTube Embeds

Discussion in 'Feedback & Assistance' started by Amaury, Mar 7, 2015.

  1. Amaury Legendary Hero

    Joined:
    Jan 15, 2007
    Gender:
    Male
    Location:
    Ellensburg, WA
    1,692
    Most of the time when I enter the song thread, because of all the YouTube embeds, my browser freezes momentarily while loading the thread. Not an extremely huge deal, but it's still annoying to deal with just about every time I enter the song thread.

    Since I'm the owner of the same type of thread on SEGA Forum, which runs vBulletin 4.1.11, I have requested that people surround their embeds in spoiler tags. By putting the video embeds in spoiler tags, it keeps the video player from loading until the spoiler tag is opened. However, this doesn't seem to work on XenForo, as I tried placing all of the videos in the blind Spyro LP projects in spoiler tags and loading performance for the threads didn't change.

    Jake Bunce from XenForo provided a solution back in June 2014 that wouldn't completely remedy the issue, but would at least noticeably alleviate it. See this post and make sure to look at the two posts below that as he made a couple of revisions.

    I sent the admins a conversation about this on June 8, 2014 (Reducing YouTube Video Loading Time), but it looks like it may have been overlooked, which is understandable, so I'm making an official suggestion now. :)
     
  2. Misty gimme kiss

    Joined:
    Sep 25, 2006
    Gender:
    Cisgender Female
    Location:
    alderaan
    6,590
    This is something I have already planned to implement (albeit using a slightly different method) when I sweep through and update our bbcode. It's on the list, just not at the top. For the time being, you may want to consider using a browser add-on that blocks loading of YT videos until clicked if it's crashing or freezing your browser.
     
  3. Misty gimme kiss

    Joined:
    Sep 25, 2006
    Gender:
    Cisgender Female
    Location:
    alderaan
    6,590
    I had some free time tonight and used it to play around with this. As you'll see below, YouTube embeds look (mostly) the same...


    Really, it's somewhat of a trick. We're actually just displaying a box with the video's thumbnail, title, and a play button, which takes very little time to load, at least compared to a standard YouTube video embed. When you click the box, however, then the actual YouTube embed will load and begin playing. It's still the same number of clicks on your part, but think of it as a sort of opt-in system -- you only have to waste your time loading the embeds that you want to see.

    Most threads won't see much of a difference, as just loading one or two YouTube embeds per page is pretty snappy. Threads like The "What Song Are You Listening to Now?" Thread, however, which typically has ten or twenty YouTube videos per page, will load much faster now. I ran PageSpeed analyses on various pages of the thread and found each page now loaded in about half the time.

    If you encounter any issues, please report them. The biggest one is that some thumbnails don't load properly -- they just display the YouTube default, which is a gray ellipsis. This isn't really an issue on our end, but YouTube's, but even so, I'll keep an eye out for a fix. Even if the thumbnail fails to load, though, clicking the frame will still fetch you the video.

    Edit: Aaaand in posting this, I've noticed that videos aren't centering properly with this! Will patch that up, shouldn't be anything big.
     
    Last edited: Mar 24, 2015
  4. Amaury Legendary Hero

    Joined:
    Jan 15, 2007
    Gender:
    Male
    Location:
    Ellensburg, WA
    1,692
    Question, @Misty: Since this was implemented, why is it that when you enter a thread with YouTube embeds, the loading indicator in the top right appears (as if you were bringing up a member card or some other type of overlay)?

    Not a bug or anything, obviously, haha, just curious as to why it happens.
     
  5. Misty gimme kiss

    Joined:
    Sep 25, 2006
    Gender:
    Cisgender Female
    Location:
    alderaan
    6,590
    The YouTube embeds use jQuery, which triggers the load indicator.
     
  6. Meilin Lee RPG (Red Panda Girl)

    Joined:
    Nov 2, 2011
    Gender:
    Male
    3,829
    Speaking of YouTube Embeds... is it me, or are the embeds not appearing at all anywhere on KHV?
     
  7. Misty gimme kiss

    Joined:
    Sep 25, 2006
    Gender:
    Cisgender Female
    Location:
    alderaan
    6,590
    It's possible you're having issues with the new embeds. Browser and device?
     
  8. libregkd -

    Joined:
    Sep 30, 2006
    2,902
    Embeds are actually broken right now, not only with them not displaying but an error regarding the media bbcode is thrown when trying to include a Youtube video in a post.
     
  9. Misty gimme kiss

    Joined:
    Sep 25, 2006
    Gender:
    Cisgender Female
    Location:
    alderaan
    6,590
    Serves me right for replying on mobile. I'll talk a look when I get home guys, I know that YouTube is phasing out some of their old API stuff so it's probably related to that.
     
  10. Misty gimme kiss

    Joined:
    Sep 25, 2006
    Gender:
    Cisgender Female
    Location:
    alderaan
    6,590


    YouTube embeds are working again. Sorry for any inconvenience!
     
  11. Amaury Legendary Hero

    Joined:
    Jan 15, 2007
    Gender:
    Male
    Location:
    Ellensburg, WA
    1,692
    @Misty, @libregkd, why are YouTube embeds appearing like this now (see the title)?

    upload_2015-5-6_20-53-29.png
     
  12. Amaury Legendary Hero

    Joined:
    Jan 15, 2007
    Gender:
    Male
    Location:
    Ellensburg, WA
    1,692
    Seems to be resolved now. Weird.[DOUBLEPOST=1431100719][/DOUBLEPOST]Nope, problem seems to be back again.
     
    Last edited: May 8, 2015
  13. Amaury Legendary Hero

    Joined:
    Jan 15, 2007
    Gender:
    Male
    Location:
    Ellensburg, WA
    1,692
    Misty, @libregkd, I found something interesting regarding this issue:

    This is an embed after submitting a post:

    YouTube 1.png

    If I edit the post, the thumbnail displays correctly, but if I refresh the page, it's "broken" again:

    YouTube 2.png