GoogleWebComponents / google-youtube

YouTube video playback web component
https://elements.polymer-project.org/elements/google-youtube
Other
131 stars 58 forks source link

Fixes the issue which broke playlist embedding functionality. #73

Closed doronin closed 7 years ago

doronin commented 7 years ago
wouldn't load unless `videoId` property is provided. This commit allows to load YouTube API when either `videoId` or `list` property is set. `list` property allows to embed YouTube playlists.
josheverett commented 7 years ago

LGTM except for the version bump. Some quick searching seems to back up that this is done separately from actual feature/bug commits:

https://github.com/GoogleWebComponents/google-youtube/commit/6a937facc241b6b7fbdb31258e2ad7744f98e39e

https://github.com/GoogleWebComponents/google-youtube/commit/58032cbd33b9123d7cf264942a599d341e10635f

jeffposnick commented 7 years ago

It's been maybe ~4 years or so since I've worked on the YouTube API team, but back in the day, you used to always need to specify a videoId when initializing the YouTube iframe embed, even when your goal was to play a list of videos. If you left out videoId, the player would get into an inconsistent state on some platforms.

To work around this, we used to tell developers to use the fake videoId 'videoseries', which is 11 characters like a real videoId, and which at least gives some clue as to what's going on.

That bug might have been fixed in the past few years, and maybe it is possible to initialize the embed without a videoId anymore. But I'd recommend checking with someone from the YouTube Player API team first to confirm. If it's still required, having it default to 'videoseries' when the list parameter is also present would continue to be the work around.

doronin commented 7 years ago

Looks like videoId is no longer required based on tests in Chrome, FF and Safari