brandly / brandly/angular-youtube-embed

YT.ready is not a function

Open
#136 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
505
Forks
145
PR merge metrics
No merged PRs in 30d

Description

I'm using `angular-youtube-embed` in an es6 webpack angular project. I'm loading the youtube iframe API from a file `youtubeapi.js`, followed by `import ./youtubeapi` in `index.js` where the angular module declaration is made:

```
import './youtubeapi';
import angular-youtube-embed from 'angular-youtube-embed';

angular.module('videoApp', [angular-youtube-embed]);
```

When navigating to a page which uses `videoApp`, I get the error `YT.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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.