aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-08-30 15:44:55 +1000
committerGitHub <noreply@github.com>2020-08-30 15:44:55 +1000
commit8b0d84a9a44111f9032ec4e5445189eac4bbbd2f (patch)
tree1f19f642dd3ed830188c16db109cf663389d1e92 /src
parentd582e43413e10d34e2de6d0e6ac59e2c105a1d9d (diff)
parentf7e9ee56d2ed5447f59e5548f005fabdab2f0a72 (diff)
downloadplyr-8b0d84a9a44111f9032ec4e5445189eac4bbbd2f.tar.lz
plyr-8b0d84a9a44111f9032ec4e5445189eac4bbbd2f.tar.xz
plyr-8b0d84a9a44111f9032ec4e5445189eac4bbbd2f.zip
Merge pull request #1935 from SBGSports/Cancel-network-requests-once-player-is-destroyed
Network requests are not cancelled after the player is destroyed
Diffstat (limited to 'src')
-rw-r--r--src/js/plyr.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index e924ac78..7835d779 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -12,6 +12,7 @@ import { getProviderByUrl, providers, types } from './config/types';
import Console from './console';
import controls from './controls';
import Fullscreen from './fullscreen';
+import html5 from './html5';
import Listeners from './listeners';
import media from './media';
import Ads from './plugins/ads';
@@ -1054,7 +1055,12 @@ class Plyr {
const hiding = toggleClass(this.elements.container, this.config.classNames.hideControls, force);
// Close menu
- if (hiding && is.array(this.config.controls) && this.config.controls.includes('settings') && !is.empty(this.config.settings)) {
+ if (
+ hiding &&
+ is.array(this.config.controls) &&
+ this.config.controls.includes('settings') &&
+ !is.empty(this.config.settings)
+ ) {
controls.toggleMenu.call(this, false);
}
@@ -1140,6 +1146,9 @@ class Plyr {
// Unbind listeners
unbindListeners.call(this);
+ // Cancel current network requests
+ html5.cancelRequests.call(this);
+
// Replace the container with the original element provided
replaceElement(this.elements.original, this.elements.container);