aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorferdiemmen <fjemmen@gmail.com>2018-01-29 22:40:08 +0100
committerferdiemmen <fjemmen@gmail.com>2018-01-29 22:40:08 +0100
commitc4eb4c97ac1f186e5054da298e4960cb498c6d01 (patch)
tree2185d27868e37f92c2413c6f250bde65f78e00cd /src/js/plyr.js
parentcc128e60888468a90dd73c90f05fc7ddbf104551 (diff)
downloadplyr-c4eb4c97ac1f186e5054da298e4960cb498c6d01.tar.lz
plyr-c4eb4c97ac1f186e5054da298e4960cb498c6d01.tar.xz
plyr-c4eb4c97ac1f186e5054da298e4960cb498c6d01.zip
fix(ads): Fixes media from playing when ads are blocked
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js5
1 files changed, 3 insertions, 2 deletions
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();