From 9ebc2719d31e39b822eda42c2eb3272330e9fc5d Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 6 May 2018 00:49:12 +1000 Subject: v3.3.0 --- src/js/plugins/ads.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/js/plugins/ads.js') diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js index b9d9ac1c..4a3deeaa 100644 --- a/src/js/plugins/ads.js +++ b/src/js/plugins/ads.js @@ -6,8 +6,8 @@ /* global google */ -import utils from '../utils'; import i18n from '../i18n'; +import utils from '../utils'; class Ads { /** @@ -52,7 +52,7 @@ class Ads { // Check if the Google IMA3 SDK is loaded or load it ourselves if (!utils.is.object(window.google) || !utils.is.object(window.google.ima)) { utils - .loadScript(this.player.config.urls.googleIMA.api) + .loadScript(this.player.config.urls.googleIMA.sdk) .then(() => { this.ready(); }) @@ -160,6 +160,9 @@ class Ads { // We only overlay ads as we only support video. request.forceNonLinearFullSlot = false; + // Mute based on current state + request.setAdWillPlayMuted(!this.player.muted); + this.loader.requestAds(request); } catch (e) { this.onAdError(e); @@ -226,7 +229,7 @@ class Ads { // Get skippable state // TODO: Skip button - // this.manager.getAdSkippableState(); + // this.player.debug.warn(this.manager.getAdSkippableState()); // Set volume to match player this.manager.setVolume(this.player.volume); -- cgit v1.2.3 From 91a4b86860f8db72dba0cec0c8cb18b93e423d85 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 6 May 2018 01:03:38 +1000 Subject: Small bug fixes --- src/js/plugins/ads.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/js/plugins/ads.js') diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js index 4a3deeaa..79c00ab3 100644 --- a/src/js/plugins/ads.js +++ b/src/js/plugins/ads.js @@ -18,7 +18,6 @@ class Ads { constructor(player) { this.player = player; this.publisherId = player.config.ads.publisherId; - this.enabled = player.isHTML5 && player.isVideo && player.config.ads.enabled && utils.is.string(this.publisherId) && this.publisherId.length; this.playing = false; this.initialized = false; this.elements = { @@ -44,6 +43,10 @@ class Ads { this.load(); } + get enabled() { + return this.player.isHTML5 && this.player.isVideo && this.player.config.ads.enabled && utils.is.string(this.publisherId) && this.publisherId.length; + } + /** * Load the IMA SDK */ -- cgit v1.2.3 From 165515009266a5dc0b625cef26cf6ba1a80bb12e Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 6 May 2018 01:32:51 +1000 Subject: v3.3.5 --- src/js/plugins/ads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/plugins/ads.js') diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js index 79c00ab3..0246e221 100644 --- a/src/js/plugins/ads.js +++ b/src/js/plugins/ads.js @@ -44,7 +44,7 @@ class Ads { } get enabled() { - return this.player.isHTML5 && this.player.isVideo && this.player.config.ads.enabled && utils.is.string(this.publisherId) && this.publisherId.length; + return this.player.isVideo && this.player.config.ads.enabled && !utils.is.empty(this.publisherId); } /** -- cgit v1.2.3