Fix #1108: Make sure youtube.onReady doesn't run twice

This commit is contained in:
Albin Larsson 2018-07-28 03:54:10 +02:00
parent d061be5d2b
commit 24deff0e2d

View File

@ -239,6 +239,10 @@ const youtube = {
triggerEvent.call(player, player.media, 'ratechange'); triggerEvent.call(player, player.media, 'ratechange');
}, },
onReady(event) { onReady(event) {
// Bail if onReady has already been called. See issue #1108
if (is.function(player.media.play)) {
return;
}
// Get the instance // Get the instance
const instance = event.target; const instance = event.target;