-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iframe optimizations #96
Conversation
Can you show a video of what this looks like, and interact with it? First impression is this looks kind of looks like a personal preference thing.. what issue does this solve? |
Its a performance boost on page load times, especially for those with poor internet speeds or devices with limited memory resources. Most users in any given site visit will not watch the youtube videos so its unnecessary to fetch them with they aren't required. It also allows you to keep adding youtube videos to the news page without hindering the performance with each video. Lastly, say the iframe fails to fetch the youtube videos for some reason, it won't create any ui problems until someone wants to watch one of the video. I do need to make it clearer to users that this is a video though. I can work on that. unknown_2024.07.17-15.18.1.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is exactly the same as index.js, I would just combine them into something called like iframeLazyLoader.js, and have both pages request that.
Okay! Seems nice! The only thing I'm worried about is it'll be annoying to have to add the thumbnail to the server files and link it with every new video. Youtube's share button gives you a copyable iframe element which all you need to do is paste, nothing else. Can the thumbnail stuff be automated? Does youtube have a url you can go to to download the thumbnail of a video? The videos on the news page are a little large, could you also shrink their size? |
Yes, I can automate the thumbnails. |
Hey just checking in, seeing if you were still working on this! |
Yes, my bad, I have been busy lately. |
All good! No rush then |
my site uses this strategy. i think this link |
Closing due to inactivity, if more progress is made on this feel free to open up another PR! |
Lazy Loads iframes for youtube videos on home and news pages by creating the iframe element only after the thumbnails for the youtube vidoes are clicked.