Skip to content

This small plugin will lazy load YouTube embed videos on your blogs and websites.

License

Notifications You must be signed in to change notification settings

yusufshakeel/dyYouTubeLazyLoadJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dyYouTubeLazyLoadJS

This small plugin will lazy load YouTube embed videos on your blogs and websites.

Status

license npm version

Getting Started

  • Download the latest release of the project.
  • Clone the repo: git clone https://github.com/yusufshakeel/dyYouTubeLazyLoadJS.git
  • Install with npm: npm install dyyoutubelazyloadjs
  • Use from jsDelivr CDN: https://www.jsdelivr.com/package/npm/dyyoutubelazyloadjs

Setup

Include CSS

Include the css file in the head.

<link rel="stylesheet" href="path/to/dist/css/dyYouTubeLazyLoad.min.css" />

Include JavaScript

Include the js file before the ending body tag.

<script src="path/to/dist/js/dyYouTubeLazyLoad.min.js"></script>

The container

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>

License

It's free and released under MIT License Copyright (c) 2019 Yusuf Shakeel

Back this project 🙏

If you find this project useful and interesting then please support it on Patreon.

Donate

Feeling generous :-) Buy me a cup of tea ☕.

Donate via PayPal