Why You Need Youtube Videos In The Website?
Youtube is currently the second largest website in the world and the second largest social media platform with 1.9 billion users worldwide.
Since 'Time on Page' is one of critical SEO Ranking Factors more and more bloggers & website masters embed Youtube videos into their articles and blog posts to increase visitors' average time spent on the sites.
How To Embed Youtube Videos In Your Page?
The fastest and simplest way to insert Youtube Videos in the page is to using iframe element:
- Visit the video on Youtube.
- Click the Share button under the video player.
- Click the Embed button in the popup.
- Copy and paste the code into your document. Done.
The problem is…
You might encounter a performance issue when embedding Youtube videos using iframe.
The webpage will instantly load Youtube videos on page load and block the DOM rendering until the video players are completely loaded.
This will greatly increase the page load time and thus damage the user experience.
To delay the loading of Youtube videos within your document, you might need lazy loading technology.
For Chrome users you can use the
loading="lazy" attribute introduced by Google.
<iframe src="video-player.html" loading="lazy"></iframe>
- Stops the auto loading of Youtube videos.
- Fetches and displays Youtube video thumbnails on the page.
- Loads the Youtube video players until the visitors click/tap the thumbnail.
The Best Youtube Video Lazy Loader
Originally Published Nov 17, 2019, updated Mar 20 2023
Table of contents:
jQuery Video Lazy Loaders:
A Youtube lazy loader plugin with jQuery that replaces the default Youtube player with its cover image and loads actual YouTube videos ONLY when needed (click the thumbnail).
Yet another jQuery Youtube video lazy load plugin that displays the thumbnail images of Youtube videos on the webpage and then plays them when clicked.
embedVideo is a simple-to-use jQuery plugin that helps you quickly embed Youtube videos into your webpages with lazy load support.
Yet another jQuery plugin that dynamically loads Youtube and Vimeo videos on demand to boost page performance. Licensed under the BSD-3-Clause.
Vanilla Youtube Video Lazy Loaders:
Yet another Youtube lazy loader that delays the loading of Youtube video player to improve the performance of your web page.
A jQuery plugin which automatically plays / stops Youtube videos when they become visible and disappear on vertical page scrolling.