fix(ads): Fixes media from playing when ads are blocked

This commit is contained in:
ferdiemmen
2018-01-29 22:40:08 +01:00
parent cc128e6088
commit c4eb4c97ac
6 changed files with 36 additions and 7 deletions

View File

@ -306,11 +306,12 @@ class Plyr {
}
/**
* Play the media, or play the advertisement
* Play the media, or play the advertisement (if they are not blocked)
*/
play() {
if (this.ads.enabled && !this.ads.initialized) {
if (this.ads.enabled && !this.ads.initialized && !this.ads.blocked) {
this.ads.play();
return;
}
this.media.play();