diff options
author | Sam Potts <sam@potts.es> | 2018-03-18 01:37:24 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-03-18 01:37:24 +1100 |
commit | 43e6dcd41dac1ea3615f1ee92a2ec665e8c7edbc (patch) | |
tree | e290a6e508452f5cd466606a9937de7412c71643 /src/js/plyr.js | |
parent | b06c8ae43fa9cce4d395dcef8a55067cb9198e8f (diff) | |
download | plyr-43e6dcd41dac1ea3615f1ee92a2ec665e8c7edbc.tar.lz plyr-43e6dcd41dac1ea3615f1ee92a2ec665e8c7edbc.tar.xz plyr-43e6dcd41dac1ea3615f1ee92a2ec665e8c7edbc.zip |
Fix for local storage issue
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r-- | src/js/plyr.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index e835b8c7..37dd14d3 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr -// plyr.js v3.0.0 +// plyr.js v3.0.1 // https://github.com/sampotts/plyr // License: The MIT License (MIT) // ========================================================================== @@ -315,6 +315,10 @@ class Plyr { * Play the media, or play the advertisement (if they are not blocked) */ play() { + if (!utils.is.function(this.media.play)) { + return null; + } + // If ads are enabled, wait for them first if (this.ads.enabled && !this.ads.initialized) { return this.ads.managerPromise.then(() => this.ads.play()).catch(() => this.media.play()); @@ -328,7 +332,7 @@ class Plyr { * Pause the media */ pause() { - if (!this.playing) { + if (!this.playing || !utils.is.function(this.media.pause)) { return; } |