diff options
author | Arthur Hulsman <a.hulsman@orangegames.com> | 2018-03-07 15:43:48 +0100 |
---|---|---|
committer | Arthur Hulsman <a.hulsman@orangegames.com> | 2018-03-07 15:43:48 +0100 |
commit | 819f7d1080ef2748fa1c123ad0f54d075c654ab9 (patch) | |
tree | 2871f9f93f00fc08b2af5871655961db739ac011 /src/js/plugins | |
parent | 409b588458fd598a88d56f3922da83ff82d80f5f (diff) | |
download | plyr-819f7d1080ef2748fa1c123ad0f54d075c654ab9.tar.lz plyr-819f7d1080ef2748fa1c123ad0f54d075c654ab9.tar.xz plyr-819f7d1080ef2748fa1c123ad0f54d075c654ab9.zip |
Resizing the ad container while having it on display none will return offset width and height of 0, which will cause ads not to play when ad sizes are set within the clients DSP. Also making sure that the inner containers of the ad container are full size. The container is now hidden/ displayed using z-index.
Diffstat (limited to 'src/js/plugins')
-rw-r--r-- | src/js/plugins/ads.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js index 0497c42c..eca523f7 100644 --- a/src/js/plugins/ads.js +++ b/src/js/plugins/ads.js @@ -111,7 +111,6 @@ class Ads { // Create the container for our advertisements this.elements.container = utils.createElement('div', { class: this.player.config.classNames.ads, - hidden: '', }); this.player.elements.container.appendChild(this.elements.container); @@ -451,8 +450,8 @@ class Ads { * Resume our video. */ resumeContent() { - // Hide our ad container - utils.toggleHidden(this.elements.container, true); + // Hide the advertisement container + this.elements.container.style.zIndex = ''; // Ad is stopped this.playing = false; @@ -467,8 +466,8 @@ class Ads { * Pause our video */ pauseContent() { - // Show our ad container. - utils.toggleHidden(this.elements.container, false); + // Show the advertisement container + this.elements.container.style.zIndex = '3'; // Ad is playing. this.playing = true; |