aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 9b73423e..d4c3d392 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -309,14 +309,15 @@ class Plyr {
* Play the media, or play the advertisement (if they are not blocked)
*/
play() {
- if (this.ads.enabled && !this.ads.initialized && !this.ads.blocked) {
+ // Return the promise (for HTML5)
+ if (this.ads.enabled && !this.ads.initialized) {
this.ads.managerPromise.then(() => {
this.ads.play();
}).catch(() => {
- this.media.play();
+ return this.media.play();
});
} else {
- this.media.play();
+ return this.media.play();
}
}