yi

youtube-iframe

Wrapper for dynamically loading the YouTube iframe api script

Showing:

Popularity

Downloads/wk

6.6K

GitHub Stars

23

Maintenance

Last Commit

5yrs ago

Contributors

4

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Readme

youtube-iframe

Wrapper for dynamically loading the YouTube iframe api script

npm install youtube-iframe

Can be used with browserify or global window.YouTubeIframeLoader.

var YouTubeIframeLoader = require('youtube-iframe');

YouTubeIframeLoader.load(function(YT) {
    new YT.Player('player1', {
        height: '390',
        width: '640',
        videoId: 'M7lc1UVf-VE'
    });
});

YouTubeIframeLoader.load(function(YT) {
    new YT.Player('player2', {
        height: '390',
        width: '640',
        videoId: 'dQw4w9WgXcQ'
    });
});

Changelog

1.0.3

  • Typescript support (#3)

1.0.2

  • Always call the callback asynchronously (#2)
  • Fixed a bug with infinite recursion when nesting load() calls

1.0.1

  • Always use https instead of the protocol-relative URL (#1)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100