youtube-player icon indicating copy to clipboard operation
youtube-player copied to clipboard

playerVars not working with loadVideoById method

Open lbineau opened this issue 6 years ago • 4 comments

player.loadVideoById({
  'videoId': 'theVideoId',
  'playerVars': { 'autoplay': 0, 'controls': 0 }
})

playerVars doesn't seems to be added to iframe url (described here https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player) Am I missing something?

lbineau avatar Jul 12 '17 07:07 lbineau

It seems that it is options for YouTubePlayer instance

let player = YouTubePlayer('domId', {
  'videoId': 'theVideoId',
  'playerVars': { 'autoplay': 0, 'controls': 0 }
})

But loadVideoById play the video automatically is it a normal behavior?

player.loadVideoById('anotherId')

lbineau avatar Jul 12 '17 07:07 lbineau

my playerVars also stopped working

joshSummerhays avatar Nov 03 '17 22:11 joshSummerhays

It is a very simple project and if you find and issue, it will be the easiest for you to replicate the issue and contribute a fix.

gajus avatar Nov 03 '17 22:11 gajus

I'm pretty sure the loadVideoById in the underlying API method doesn't allow for playerVars. https://developers.google.com/youtube/iframe_api_reference#loadVideoById

drewbaker avatar May 12 '20 18:05 drewbaker