npm-dom / youtube-video

Add Youtube videos into your page

Home Page:http://npm.im/youtube-video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Selector

bienvenidosaez opened this issue · comments

Hi! Today I tried youtube-video and have found a small error that has confused me a bit. In your example:

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

But elementId not work if it is not indicated as an option: selector: true.

Excuse my English, I'm Spanish.

Yeah, I had the same issue as bienvenidosaez... because of this line: https://github.com/npm-dom/youtube-video/blob/master/index.js#L22 you need to specify an option selector: "some truthy value" to get it to use the the element ID.

Fixed by #6