Selector
bienvenidosaez opened this issue · comments
Bienvenido Sáez Muelas commented
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.
Mr Speaker commented
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.