From 266b70d9d083c99b606bbf63f1a05e0cfe52a18c Mon Sep 17 00:00:00 2001 From: Jimmy Jia Date: Mon, 1 Apr 2019 14:42:51 -0400 Subject: [PATCH] fix: Properly clear all timeouts on destroy --- src/js/plyr.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index 0d3d1674..e28c5da3 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1088,11 +1088,13 @@ class Plyr { // Stop playback this.stop(); + // Clear timeouts + clearTimeout(this.timers.loading); + clearTimeout(this.timers.controls); + clearTimeout(this.timers.resized); + // Provider specific stuff if (this.isHTML5) { - // Clear timeout - clearTimeout(this.timers.loading); - // Restore native video controls ui.toggleNativeControls.call(this, true);