aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMrSnowflake <mrsnowflake@gmail.com>2016-05-30 00:35:07 +0200
committerMrSnowflake <mrsnowflake@gmail.com>2016-05-30 00:35:07 +0200
commit152e94f2298530d0f2661bef6fe2a52fc41aaa6f (patch)
tree02689f4609d723cb89ea59187611da9e6b6c7aa0
parentac0061b83e2c3387beaa74dbd92f3d6a60b26453 (diff)
downloadplyr-152e94f2298530d0f2661bef6fe2a52fc41aaa6f.tar.lz
plyr-152e94f2298530d0f2661bef6fe2a52fc41aaa6f.tar.xz
plyr-152e94f2298530d0f2661bef6fe2a52fc41aaa6f.zip
Improved YT initialized check.
Added an extra check to see wether YT API has been initialized. The current check is inadequate as YT can be an object while the API still isn't completely initialized.
-rw-r--r--src/js/plyr.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 6f5b4aeb..d6b16b7b 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1382,7 +1382,7 @@
container.setAttribute('id', id);
// Setup API
- if (typeof YT === 'object') {
+ if (typeof YT === 'object' && YT.loaded !== 0) {
_youTubeReady(mediaId, container);
}
else {