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() {
// 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();