diff options
author | Sam Potts <sam@potts.es> | 2018-03-15 10:29:05 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-03-15 10:29:05 +1100 |
commit | 5cb1628cd8f9d58b97bf1bf774ff89f61ceb31d5 (patch) | |
tree | d8f96b27b1ff26e106a02276b6ae593a694e9388 /src/js/plyr.js | |
parent | c74b75e8e189b187b1323f0a5e0b2ec106fcfd34 (diff) | |
download | plyr-5cb1628cd8f9d58b97bf1bf774ff89f61ceb31d5.tar.lz plyr-5cb1628cd8f9d58b97bf1bf774ff89f61ceb31d5.tar.xz plyr-5cb1628cd8f9d58b97bf1bf774ff89f61ceb31d5.zip |
Vimeo fix
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r-- | src/js/plyr.js | 7 |
1 files changed, 7 insertions, 0 deletions
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; |