youtube-video
npm i youtube-video

youtube-video

Add Youtube videos into your page

by npm-dom

2.2.0 (see all)License:BSDTypeScript:Not Found
npm i youtube-video
Readme

youtube-video

Minimalistic API to play Youtube videos

youtubeVideo = require('youtube-video')
youtubeVideo('sl1Q6W0UzGk', {
  elementId: 'foobar',
  width: 640,
  height: 390,
  autoplay: true,
  controls: false,
  onPlay: onPlay,
  onEnd: onEnd,
  onPause: onPause
})

Install

$ npm install youtube-video

API

youtubeVideo(video-id or video-url, onReady)

youtubeVideo('https://www.youtube.com/watch?v=rfh4Mhp-a6U', function (error, playback) {
  playback.playVideo()
})

youtubeVideo(video-id or video-url, options, onReady)

youtubeVideo = require('youtube-video')
youtubeVideo('sl1Q6W0UzGk', {
  elementId: 'player', // by default: youtube-video
  width: 640,
  height: 390,
  autoplay: true,
  controls: false,
  onPause: onPause,
  onPlay: onPlay,
  onEnd: onEnd
})

Downloads/wk

57

GitHub Stars

14

LAST COMMIT

4yrs ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
2.2.0
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial