aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-03-29 12:02:59 +1100
committerSam Potts <sam@potts.es>2020-03-29 12:02:59 +1100
commit09598f07bf062886bfa22cd8682948567e92a19a (patch)
tree2ed0de186d43b2cc27422115fe75600a12e5d303 /src/js/plyr.js
parentef7b30c1b8a0e2d9a8cb71dfb41af0706bb8886e (diff)
parent155add66bd5b941699cea99f5c94cf8a87b030d8 (diff)
downloadplyr-09598f07bf062886bfa22cd8682948567e92a19a.tar.lz
plyr-09598f07bf062886bfa22cd8682948567e92a19a.tar.xz
plyr-09598f07bf062886bfa22cd8682948567e92a19a.zip
Merge branch 'develop' of github.com:sampotts/plyr into develop
# Conflicts: # package.json # yarn.lock
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 00d33463..00b95a5f 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -27,6 +27,7 @@ import is from './utils/is';
import loadSprite from './utils/load-sprite';
import { clamp } from './utils/numbers';
import { cloneDeep, extend } from './utils/objects';
+import { silencePromise } from './utils/promise';
import { getAspectRatio, reduceAspectRatio, setAspectRatio, validateRatio } from './utils/style';
import { parseUrl } from './utils/urls';
@@ -303,7 +304,7 @@ class Plyr {
// Autoplay if required
if (this.isHTML5 && this.config.autoplay) {
- setTimeout(() => this.play(), 10);
+ setTimeout(() => silencePromise(this.play()), 10);
}
// Seek time will be recorded (in listeners.js) so we can prevent hiding controls for a few seconds after seek
@@ -356,7 +357,7 @@ class Plyr {
// Intecept play with ads
if (this.ads && this.ads.enabled) {
- this.ads.managerPromise.then(() => this.ads.play()).catch(() => this.media.play());
+ this.ads.managerPromise.then(() => this.ads.play()).catch(() => silencePromise(this.media.play()));
}
// Return the promise (for HTML5)