From 5cb1628cd8f9d58b97bf1bf774ff89f61ceb31d5 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Thu, 15 Mar 2018 10:29:05 +1100 Subject: Vimeo fix --- src/js/plyr.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/js/plyr.js') diff --git a/src/js/plyr.js b/src/js/plyr.js index 4ab2a64a..32c8c062 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1029,6 +1029,10 @@ class Plyr { * @param {boolean} soft - Whether it's a soft destroy (for source changes etc) */ destroy(callback, soft = false) { + if (!this.ready) { + return; + } + const done = () => { // Reset overflow (incase destroyed while in fullscreen) document.body.style.overflow = ''; @@ -1071,6 +1075,9 @@ class Plyr { callback.call(this.elements.original); } + // Reset state + this.ready = false; + // Clear for garbage collection setTimeout(() => { this.elements = null; -- cgit v1.2.3