brandly / angular-youtube-embed

:tv: Embed a YouTube player with a simple directive
http://brandly.github.io/angular-youtube-embed/
MIT License
508 stars 147 forks source link

player is not defined #124

Closed ezazwar1 closed 8 years ago

ezazwar1 commented 8 years ago

i tried to close video function but that doesnt seem to be working

player is not defined error is thrown

brandly commented 8 years ago

could you make a JSFiddle or something similar to show what code produces the error?

the player gets defined asynchronously, so there's a chance you're trying to access a method on it before it's define. it's best to wait for a youtube.player.ready event, as documented here, before accessing the player object.

brandly commented 8 years ago

if this error is reproducible, let me know! i'm closing this in the meantime, until there's some example code to work with 🎆