gajus / youtube-player

YouTube iframe API abstraction.
Other
364 stars 80 forks source link

Fix playing inside iframe or popup window #77

Closed nathanstitt closed 5 years ago

nathanstitt commented 5 years ago

When attempting to instantiate inside an iframe or popup window, the element can't be read, and the else block with throw new TypeError('Unexpected state.'); would be triggered.

It seems to me that it'd be a better to always attempt to play even if we can't tell if a player can be added to an element or not.