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.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js
index 5c828141..c59c4667 100644
--- a/src/js/plugins/ads.js
+++ b/src/js/plugins/ads.js
@@ -18,6 +18,7 @@ class Ads {
this.player = player;
this.playing = false;
this.initialized = false;
+ this.blocked = false;
this.enabled = utils.is.url(player.config.ads.tag);
// Check if a tag URL is provided.
@@ -25,10 +26,15 @@ class Ads {
return;
}
- // Check if the Google IMA3 SDK is loaded
+ // Check if the Google IMA3 SDK is loaded or load ourselves.
if (!utils.is.object(window.google)) {
utils.loadScript(player.config.urls.googleIMA.api, () => {
this.ready();
+ }, () => {
+
+ // Script failed to load or is blocked.
+ this.blocked = true;
+ this.player.debug.log('Ads error: Google IMA SDK failed to load');
});
} else {
this.ready();