aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins/ads.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-05-06 00:49:12 +1000
committerSam Potts <sam@potts.es>2018-05-06 00:49:12 +1000
commit9ebc2719d31e39b822eda42c2eb3272330e9fc5d (patch)
tree4f9c6d2eaea36caa689e9d852ce8e1490c631183 /src/js/plugins/ads.js
parent5ca769807e773d6d6a884771ca8864e4db8c1376 (diff)
downloadplyr-9ebc2719d31e39b822eda42c2eb3272330e9fc5d.tar.lz
plyr-9ebc2719d31e39b822eda42c2eb3272330e9fc5d.tar.xz
plyr-9ebc2719d31e39b822eda42c2eb3272330e9fc5d.zip
v3.3.0
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 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);