Made sure play() returns a promise.

This commit is contained in:
Arthur Hulsman 2018-03-09 12:50:57 +01:00
parent 69ffcbad27
commit ba8d7831a7

View File

@ -311,10 +311,10 @@ class Plyr {
play() { play() {
// Return the promise (for HTML5) // Return the promise (for HTML5)
if (this.ads.enabled && !this.ads.initialized) { if (this.ads.enabled && !this.ads.initialized) {
this.ads.managerPromise.then(() => { return this.ads.managerPromise.then(() => {
this.ads.play(); this.ads.play();
}).catch(() => { }).catch(() => {
return this.media.play(); this.media.play();
}); });
} else { } else {
return this.media.play(); return this.media.play();