aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-01-22 23:39:09 +1100
committerSam Potts <sam@potts.es>2018-01-22 23:39:09 +1100
commitebf53d14b12c025b6c2f37a887a55e2bf7ab3b7d (patch)
tree5de42abba738b27100fbc5c63f821d7c7979c9a0 /src/js/plyr.js
parentb298587c0b8c76bcf85a112585f7a9a4c1100eb8 (diff)
downloadplyr-ebf53d14b12c025b6c2f37a887a55e2bf7ab3b7d.tar.lz
plyr-ebf53d14b12c025b6c2f37a887a55e2bf7ab3b7d.tar.xz
plyr-ebf53d14b12c025b6c2f37a887a55e2bf7ab3b7d.zip
Small tweaks
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 9a3c0afb..3d0f79a7 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
-// plyr.js v3.0.0-beta.4
+// plyr.js v3.0.0-beta.5
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================
@@ -276,9 +276,7 @@ class Plyr {
}
// Setup ads if provided
- if (utils.is.url(this.config.ads.tagUrl)) {
- this.ads = new Ads(this);
- }
+ this.ads = new Ads(this);
}
// ---------------------------------------
@@ -311,17 +309,20 @@ class Plyr {
* Play the media, or play the advertisement
*/
play() {
- if (utils.is.url(this.config.ads.tagUrl)) {
+ if (this.ads.enabled) {
if (this.ads.playing) {
return;
}
+
if (!this.ads.initialized) {
this.ads.play();
}
+
if (!this.ads.playing) {
this.media.play();
}
}
+
this.media.play();
}