mR12

Load Videos on click (aka Lazy Loading) or normal embed?

Load Videos on click (aka Lazy Loading) or normal embed (site is slower)?  

66 members have voted

  1. 1. Which do you agree with the most?

    • Lazy Loading YouTube Videos (improves site load and performance)
      47
    • Normal Loading YouTube Videos (gets rid of black boxes in Shoutbox)
      19


23 posts in this topic

The ProblemPulling in an external resource like a YouTube video may slow down a web page’s load performance, especially if there are two or more videos embedded on the same page (we usually have ~10 on the homepage). By embedding videos we request more than just a video file. A number of resources are fetched, including JavaScript files, a stylesheet, images, and advertisements. Two YouTube videos equates to 22 HTTP requests with a total of 624kb downloaded. These numbers will climb as we embed more videos on the page.

 

The Solution: Instead of loading the YouTube video as soon as the page loads, we want to pull and play the video when the user asks to do so. This method is popularly known as lazy loading - it will minimize the HTTP requests on initial page load, and ultimately improve the page’s performance.

 

The Problem With The Solution: Lazy loading works fine everywhere else on the site. Besides the Shoutbox. When one posts a video in the Shoutbox, the script does not call the play button and image to the JFrame, causing a black box only to appear. This is due to conflicting Shoutbox JS code and Ajax.

 

fef49960190fc410a8323ee196ab8bfa.png

 

The two sides of the debate:

 

For Lazy-Loading YouTube VideosMain argument is that it greatly improves overall site load and performance. For the site to load, all of YouTube's resources must be pulled in by the browser, and you cannot scroll up or down or click on anything until all the videos on the site are loaded. Lazy loading simply replaces all of YouTube's resources with an image and a play button. For the users that don't use the Shoutbox, this is an easy fix. "Overall I just think faster loading is more important, maybe 1% of users use the Shoutbox regularly" says active KL user @@LKA.

 

Against Lazy-Loading YouTube Videos: It's a pain to refresh the Shoutbox every time someone posts a YouTube video. It is not appealing whatsoever to new users, and is just an overall hassle. @@Smash_Adams, another active KL user, brings up that because the black box appears, for one to play the video in the Shoutbox, it's "on refresh" rather than "on click"

 

Anyone is welcome to vote and voice their opinions in this topic! You may be swayed one way or another by the info above or by other users comments, so read before voting!

Share this post


Link to post
Share on other sites

Is there some sort of a possibility to make embedded videos work like spoiler tags? They won't load until you press a [Youtube Link] button or something of that sort? 

Pretty sure HTML loads the content of spoilers before it's opened.

Share this post


Link to post
Share on other sites

Couldn't you get rid of the boxes altogether in the Shoutbox? Personally, I think the big boxes next to normal size text looks aesthetically unappealing. 

Those boxes are what youtube videos load as right now unless you refresh the page. Is that the confusion?

Share this post


Link to post
Share on other sites

Those boxes are what youtube videos load as right now unless you refresh the page. Is that the confusion?

 

I mean embedded videos altogether. Maybe there's a plug-in that just posts the title and link in the shoutbox?

Share this post


Link to post
Share on other sites

I mean embedded videos altogether. Maybe there's a plug-in that just posts the title and link in the shoutbox?

I have thought about that. But I don't have enough experience nor does the Shoutbox have enough support to attempt that. Good idea though

Share this post


Link to post
Share on other sites

Honestly I think the the site loads and works great I love being able stay on the homepage and click a new song I see let it play as I scroll down and see what else was posted recently I end up checking out more bands because it's so easily accessible if I had to click into every post to hear it I wouldn't listen to nearly as many. Thank you guys/girls for all the hard work you put into KL its been awesome to watch it grow over time and become the awesome site it is today!!

Share this post


Link to post
Share on other sites

Honestly I think the the site loads and works great I love being able stay on the homepage and click a new song I see let it play as I scroll down and see what else was posted recently I end up checking out more bands because it's so easily accessible if I had to click into every post to hear it I wouldn't listen to nearly as many. Thank you guys/girls for all the hard work you put into KL its been awesome to watch it grow over time and become the awesome site it is today!!

And you can do that right now! We have already applied the Lazy Load script.

Share this post


Link to post
Share on other sites

So either you changed something a few hours back related to this or the site got fucked again and the shoutbox isn't working again :| Also I see "Google site search" appeared near the search, that could be the case too.

Share this post


Link to post
Share on other sites

I'm definitely all for better performance, but I would definitely like to be able to see what the video is before I load it. That way we don't have to click every video in hopes that there's something we like. But that's kinda me being lazy about lazy loading haha

Share this post


Link to post
Share on other sites

I have thought about that. But I don't have enough experience nor does the Shoutbox have enough support to attempt that. Good idea though

If the shoutbox supported hyperlinks, the title, etc. would be able to be the actual hyperlink. If it could be coded to open the loaded embed after clicking the hyperlink, that would definitely work. But I don't know much about coding or what you all have to work with on that. Perfect scenario would be the YouTube link automatically converted into a hyperlink using the title of the video as the text, instead of the person shouting having to type the title out. I hope that made sense haha.

Share this post


Link to post
Share on other sites

I'm definitely all for better performance, but I would definitely like to be able to see what the video is before I load it. That way we don't have to click every video in hopes that there's something we like. But that's kinda me being lazy about lazy loading haha

lazy about lazy loading.. i like that lolol

Share this post


Link to post
Share on other sites

And you can do that right now! We have already applied the Lazy Load script.

I have been wondering why the site takes like 30 secs to load and let me do anything lately. I hate it. I am for whatever stops that.

Share this post


Link to post
Share on other sites

So either you changed something a few hours back related to this or the site got fucked again and the shoutbox isn't working again :| Also I see "Google site search" appeared near the search, that could be the case too.

That seemed to have fixed it - however it doesn't account for the shoutbox bugs that had been occurring for the past few weeks :/

Share this post


Link to post
Share on other sites

That seemed to have fixed it - however it doesn't account for the shoutbox bugs that had been occurring for the past few weeks :/

Yep, the issue I wrote about in the post is fixed now. Hopefully it doesn't come back, well done.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now