aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-07-29 00:19:37 +1000
committerGitHub <noreply@github.com>2018-07-29 00:19:37 +1000
commit44b5d9f6b9d18e15d10930c72212774c57d1a034 (patch)
treea0c40626c3568ed51463200343926fbc827788b8
parent71578e07ec81f5f3cf3fb3faecd92ab9c7df001f (diff)
parent24deff0e2d6f85cfb9a0dfc19444aa66edf8d469 (diff)
downloadplyr-44b5d9f6b9d18e15d10930c72212774c57d1a034.tar.lz
plyr-44b5d9f6b9d18e15d10930c72212774c57d1a034.tar.xz
plyr-44b5d9f6b9d18e15d10930c72212774c57d1a034.zip
Merge pull request #1131 from friday/1108
Make sure youtube.onReady doesn't run twice
-rw-r--r--src/js/plugins/youtube.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js
index 99a505c5..66a73acf 100644
--- a/src/js/plugins/youtube.js
+++ b/src/js/plugins/youtube.js
@@ -240,6 +240,10 @@ const youtube = {
triggerEvent.call(player, player.media, 'ratechange');
},
onReady(event) {
+ // Bail if onReady has already been called. See issue #1108
+ if (is.function(player.media.play)) {
+ return;
+ }
// Get the instance
const instance = event.target;