Open jsindos opened 8 years ago
could you try doing import YT from './youtubeapi'
?
i'm not sure what ./youtubeapi
exports, since i've never loaded it with an import statement like that, but it's worth a shot 🌟
Is it possible YT.ready (in line 101 of angular-youtube-embed.js) should actually be YT.load? When I look at the source of youtube-iframe, it seems to have a function called "load" that accepts a callback, but not a function called "ready".
I'm having the same problem. I don't know where YT.ready is supposed to come from. We're making a Cordova phonegap app, so we can't load external scripts from, say, youtube. I downloaded the script that www.youtube.com/iframe_api
installs and am including that, but I also get the same error:
TypeError: YT.ready is not a function
When I debug and inspect the YT variable I get this:
What is YT supposed to look like?
I'm using
angular-youtube-embed
in an es6 webpack angular project. I'm loading the youtube iframe API from a fileyoutubeapi.js
, followed byimport ./youtubeapi
inindex.js
where the angular module declaration is made:When navigating to a page which uses
videoApp
, I get the errorYT.ready is not a function
.On refreshing the page, the error goes away. I'm wondering how to make sure the youtube API has loaded before
angular-youtube-embed
directives are run?