1.1.1 • Published 3 years ago

youtube-lazyload v1.1.1

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

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

  1. npm install youtube-lazyload

  2. 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>
  1. Use the following style:

Source

1.1.1

3 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago