Amphtml: amp-ima-video: data-ad-label could not access the number of ads - (undefined of undefined)

Created on 9 Sep 2020  路  4Comments  路  Source: ampproject/amphtml

Please only file reports about bugs in AMP here.

What's the issue?

The number of ads is showing as undefined inside the data-ad-label template.

How do we reproduce the issue?

You could reproduce the issue, which is rendered as Ad (undefined of undefined), in the AMP playground when the ad is playing.

https://playground.amp.dev/?url=https%3A%2F%2Fpreview.amp.dev%2Fdocumentation%2Fexamples%2Fcomponents%2Famp-ima-video&format=websites&_gl=11prbdkk_ga*YW1wLU43VkhYRWh3S1VEWVRWREdSaUNhalE.

What browsers are affected?

All major browsers.

Which AMP version is affected?

amp-ima-video-0.1.js

Thanks!

amp-ima-video Developer Bug components

All 4 comments

Thanks @ethan-chong!

The issue is inside an external library, https://imasdk.googleapis.com/js/sdkloader/ima3.js, which is not part of the amphtml repo. I'll forward this to an appropriate person at Google to look at.


These get mangled on compilation (see .l, .h):

    Nx.prototype.adPosition = Nx.prototype.h;
    Nx.prototype.currentTime = Nx.prototype.currentTime;
    Nx.prototype.duration = Nx.prototype.duration;
    Nx.prototype.totalAds = Nx.prototype.l;

AMP references them here, (handles IMA's event google.ima.AdEvent.Type.AD_PROGRESS):

https://github.com/ampproject/amphtml/blob/39ec8ae6737e1c0272240880bb9d4a36ed1197eb/ads/google/imaVideo.js#L903

I can see these props are mangled when read:

image

ahhh, that makes sense, @alanorozco thanks for the thorough explanation mate!

@ethan-chong Happy to help!

Found out that we can work around this on AMP's side so expect a fix soon (#30249)

@alanorozco legend :) thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

choumx picture choumx  路  3Comments

cvializ picture cvializ  路  3Comments

choumx picture choumx  路  3Comments

edhollinghurst picture edhollinghurst  路  3Comments

Download picture Download  路  3Comments