aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins
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/plugins
parentb298587c0b8c76bcf85a112585f7a9a4c1100eb8 (diff)
downloadplyr-ebf53d14b12c025b6c2f37a887a55e2bf7ab3b7d.tar.lz
plyr-ebf53d14b12c025b6c2f37a887a55e2bf7ab3b7d.tar.xz
plyr-ebf53d14b12c025b6c2f37a887a55e2bf7ab3b7d.zip
Small tweaks
Diffstat (limited to 'src/js/plugins')
-rw-r--r--src/js/plugins/ads.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js
index 8c9baf71..dd942b49 100644
--- a/src/js/plugins/ads.js
+++ b/src/js/plugins/ads.js
@@ -18,10 +18,11 @@ class Ads {
this.player = player;
this.playing = false;
this.initialized = false;
+ this.enabled = utils.is.url(player.config.ads.tagUrl);
// Check if a tag URL is provided.
- if (!utils.is.url(player.config.ads.tagUrl)) {
- return this;
+ if (!this.enabled) {
+ return;
}
// Check if the Google IMA3 SDK is loaded
@@ -456,7 +457,9 @@ class Ads {
*/
cancel() {
// Pause our video
- this.resumeContent();
+ if (this.initialized) {
+ this.resumeContent();
+ }
// Tell our instance that we're done for now
this.handleEventListeners('ERROR');