1.1.1 • Published 3 years ago
youtube-lazyload v1.1.1
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 <code>data-fullscreen="true"</code>. 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 <code>data-fullscreen="false"</code>
Use the following style: