aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins/ads.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/plugins/ads.js')
-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');