From c4eb4c97ac1f186e5054da298e4960cb498c6d01 Mon Sep 17 00:00:00 2001 From: ferdiemmen Date: Mon, 29 Jan 2018 22:40:08 +0100 Subject: fix(ads): Fixes media from playing when ads are blocked --- src/js/plyr.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/js/plyr.js') diff --git a/src/js/plyr.js b/src/js/plyr.js index 36b74e76..3cbbed4b 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -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(); -- cgit v1.2.3