aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArthur Hulsman <a.hulsman@orangegames.com>2018-03-09 12:50:57 +0100
committerArthur Hulsman <a.hulsman@orangegames.com>2018-03-09 12:50:57 +0100
commitba8d7831a7eb374e4ccf31e83a731019e900c7a3 (patch)
tree2f28317258604c2441e121f8484efd09beab2408 /src
parent69ffcbad27353bfd0238ba7e79e6caf3835b0efd (diff)
downloadplyr-ba8d7831a7eb374e4ccf31e83a731019e900c7a3.tar.lz
plyr-ba8d7831a7eb374e4ccf31e83a731019e900c7a3.tar.xz
plyr-ba8d7831a7eb374e4ccf31e83a731019e900c7a3.zip
Made sure play() returns a promise.
Diffstat (limited to 'src')
-rw-r--r--src/js/plyr.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index d4c3d392..7b4ddd5b 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -311,10 +311,10 @@ class Plyr {
play() {
// Return the promise (for HTML5)
if (this.ads.enabled && !this.ads.initialized) {
- this.ads.managerPromise.then(() => {
+ return this.ads.managerPromise.then(() => {
this.ads.play();
}).catch(() => {
- return this.media.play();
+ this.media.play();
});
} else {
return this.media.play();