Fix bug where ad would play on every play action
This commit is contained in:
@ -485,9 +485,6 @@ class Ads {
|
||||
this.player.debug.log(this.manager);
|
||||
});
|
||||
|
||||
// Make sure we can re-call advertisements
|
||||
this.initialized = false;
|
||||
|
||||
// Now request some new advertisements
|
||||
this.requestAds();
|
||||
});
|
||||
|
@ -309,18 +309,8 @@ class Plyr {
|
||||
* Play the media, or play the advertisement
|
||||
*/
|
||||
play() {
|
||||
if (this.ads.enabled) {
|
||||
if (this.ads.playing) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.ads.initialized) {
|
||||
this.ads.play();
|
||||
}
|
||||
|
||||
if (!this.ads.playing) {
|
||||
this.media.play();
|
||||
}
|
||||
if (this.ads.enabled && !this.ads.initialized) {
|
||||
this.ads.play();
|
||||
}
|
||||
|
||||
this.media.play();
|
||||
|
Reference in New Issue
Block a user