Where does IMA get the values to pass as width, height to initAd when consuming a VPAID ad?

184 views
Skip to first unread message

Slavko Krstic

unread,
Nov 18, 2016, 3:13:25 PM11/18/16
to Interactive Media Ads SDK
I would assume it's from AdDisplayContainer, which gets it from the containerElement parameter in its constructor, and then cascades it to AdsLoader when it gets passed to its constructor.

Is this assumption wrong?

Do you have any idea why it would be passing 0,0 for height and width, when the container element passed to AdDisplayContainer has explicit pixel dimensions?

Thanks in advance!!

Slavko


Vu Chau (IMA SDK Team)

unread,
Nov 18, 2016, 5:06:15 PM11/18/16
to Interactive Media Ads SDK
Hi Slavko,

The SDK shouldn't be passing 0,0 for the width and height.  It fetches the dimensions that you passed in for the content player, because we want the ad player to match the content player's size. 

Do you have a page where we can see the issue, or were you able to reproduce that in the VSI/sample examples?

Vu Chau
IMA SDK Team

Slavko Krstic

unread,
Nov 22, 2016, 4:25:29 PM11/22/16
to Interactive Media Ads SDK
@Vu -- unfortunately I'm not allowed to provide you a test page.

Upon further investigation, I'm seeing that the window in which the iFrame with loader12.html is rendered has innerHeight/innerWidth of 0, which is the reason that's 0x0 is being sent to initAd().

Interestingly, in insecure VPAID mode, the same thing does not happen -- initAd is sent the correct dimensions. However, I need to use secure (ENABLED) for other reasons.

I can confirm that I'm doing everything consistently to the examples you linked to. I can also confirm that correct values are sent to adsManager's init().

Any speculation would be much appreciated.


On Friday, November 18, 2016 at 3:13:25 PM UTC-5, Slavko Krstic wrote:

Slavko Krstic

unread,
Nov 22, 2016, 4:34:44 PM11/22/16
to Interactive Media Ads SDK
@vu -- and another follow-up: the iFrame with loader12.html gets rendered with "display:none". That's why innerHeight/innerWidth of its window are 0. If I manually change that to "block", before it has the chance to call initAd on the VPAID ad unit, everything seems to work fine.

Any clues?

Vu Chau (IMA SDK Team)

unread,
Nov 22, 2016, 4:44:04 PM11/22/16
to Interactive Media Ads SDK
Hi Slavko,

Is every VPAID ad sending 0x0 to the adsManager or is it only a specific one that is doing that? It seems to me it is an internal issue from within the VPAID's code, since rendering it in INSECURE does not reproduce the issue because the ad can create whatever (in this case an iframe) it wants.  My theory is that the ad behaves weirdly in ENABLED because the SDK restricts its access to the DOM.

Vu Chau
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages