youtube-lazyload
v1.1.1
Published
Lazy load youtube video
Downloads
11
Readme
Lazyload Youtube video
Install this package and lazy load all the youtube video with the class "youtube". Ideal for loading the site quickly.
How to Use
npm install youtube-lazyload
On HTML use following code:
<div class="wrapper"> <div class="youtube" data-embed="EQW3n5aGdSI"> <div class="play-button"></div> </div> </div>
Note:
Value of the data-embed is the id of the youtube video. For e.g.
if the youtube link is: https://www.youtube.com/embed/EQW3n5aGdSI
then, the data-embed is : EQW3n5aGdSI
To allow fullscreen, add attribute data-fullscreen="true". For e.g.
<div class="wrapper"> <div class="youtube" data-embed="EQW3n5aGdSI" data-fullscreen="true"> <div class="play-button"></div> </div> </div>
To disable fullscreen, either remove attribute "data-fullscreen" or set it to false data-fullscreen="false"
Use the following style: