This small plugin will lazy load YouTube embed videos on your blogs and websites.
Download GitHubCreated by: Yusuf Shakeel
It's free and released under MIT License Copyright (c) 2019 Yusuf Shakeel
Include the css file in the head.
<link
rel="stylesheet"
href="path/to/dist/css/dyYouTubeLazyLoad.min.css" />
Include the js file before the ending body tag.
<script src="path/to/dist/js/dyYouTubeLazyLoad.min.js"></script>
Create div having class to dy-yt-lazyload and
data-videoid
attribute to the YouTube video id.
Example:
<div class="dy-yt-lazyload-container"
data-videoid="FZjXYSmCntU"></div>
Copyright © Yusuf Shakeel
MIT License