lazy-youtube

2.2.0 • Public • Published

lazy-youtube.js

Build Status

Description

This is a JavaScript module to lazy load Youtube videos, Browserify/Node.js-style fork of https://github.com/tylerpearson/lazyYT, that does not depend on jQuery. On the initial load, the div will be appended by a preview img of the video. On click of the image, the preview img will be replaced by the autoplaying iframe Youtube video.

Setup

npm install lazy-youtube

HTML:

<div class="lazyYT" data-youtube-id="_oEA18Y8gM0" ></div>

JavaScript:

var lazyYoutube = require('lazy-youtube');
 
// Init element
lazyYoutube(element);

CSS:

Add lazyyt.css into the page

License

(CC) Creative Commons

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.2.0
    29
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.2.0
    29
  • 2.1.0
    1
  • 2.0.1
    1
  • 2.0.0
    1
  • 1.0.1
    1

Package Sidebar

Install

npm i lazy-youtube

Weekly Downloads

33

Version

2.2.0

License

CC

Last publish

Collaborators

  • iefserge