Merge pull request #1404 from taion/clear-timeouts

fix: Properly clear all timeouts on destroy
This commit is contained in:
Sam Potts 2019-04-11 21:18:52 +10:00 committed by GitHub
commit a8456f4ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);