question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AdDisplayContainer size issue

See original GitHub issue

Hi,

When the player is initialized inside a hidden container, adsManager is not initialized.

<div style="display:none">
var player = videojs()...
player.on("adserror", function (data) {
    console.error("adserror", data); // console doesn't show any errors
});
player.ima(options);
player.one('click', function() {
    player.ima.initializeAdDisplayContainer();
    player.ima.requestAds();
});
</div>

adsLoader doesn’t trigger AD_ERROR or ADS_MANAGER_LOADED events. if take a look on “SdkImpl.initAdObjects” then I see: adDisplayContainer.width is 0 adDisplayContainer.height is 0 getPlayerWidth() - 900 getPlayerHeight() - 560

and here is screenshot of AdLoader after click / requestAd: image

Please advise how to correctly initialize plugin in such situation.

Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mysufcommented, Aug 24, 2018

Note that display: none results in no width/height while visibility: hidden hides element, but preserve dimensions.

0reactions
Kiro705commented, Oct 22, 2019

Hi @onix-sergey ,

I am going to close this issue, but please feel free to reopen if the problem persists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where does IMA get the values to pass as width, height to ...
I would assume it's from AdDisplayContainer, which gets it from the containerElement ... Do you have a page where we can see the...
Read more >
Google IMA sdk - Maximum call stack size exceeded
I setup the adDisplayContainer; I have added a watcher to detect the issue. THE CODE: this.adDisplayContainer = new google.ima.
Read more >
Get started | IMA SDK for HTML5 - Google Developers
AdDisplayContainer : A container object where ads are rendered. ... this element's width controls the effective height */ /* of the video container's ......
Read more >
Changes to the IMA SDK for iOS - Google Ads Developer Blog
adDisplayContainer = [[IMAAdDisplayContainer alloc] initWithAdContainer:self. ... each of which is initialized with a width and height.
Read more >
VideoAdUnit AdUnit:Instream for Header Bidding
Create a new Video Instream Ad Unit associated with a Prebid Server configuration ID and a video size. See AdUnit for additional parameters...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found