Made sure play() returns a promise.
This commit is contained in:
parent
69ffcbad27
commit
ba8d7831a7
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user