aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js7
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;