IMA SDK HTML5 - getAd() returning null

121 views
Skip to first unread message

rafa...@gmail.com

unread,
Feb 16, 2022, 12:44:55 PM2/16/22
to Interactive Media Ads SDK
Hi,

I was trying to implement the workflow indicated at https://developers.google.cn/interactive-media-ads/docs/sdks/html5/client-side/audio, but when I use 

const ad = event.getAd()

during the AD_PROGRESS event, ad is always null, so I don't have access to the getSkipTimeOffset() method.

This is a snippet of what I have implemented:

private _eventHandler(event: any): void {
const ad = event.getAd();
switch (event.type) {
// Other events code...
case google.ima.AdEvent.Type.AD_PROGRESS:
const progressData = event.getAdData();
const offset = ad ? ad.getSkipTimeOffset() : -1; // Here, it's always -1 because there's no ad data object
// Other code not relevant...
break;
default:
break;
}
}

Does anybody have a clue on what could be the issue here?

Thanks in advance,

IMA SDK

unread,
Feb 17, 2022, 1:45:45 AM2/17/22
to rafa...@gmail.com, ima...@googlegroups.com

Hello,

 

I'm Michael from IMA SDK Team, thank you for bringing up your concern to us.

 

We do have some sample apps you can use as reference for your own integration to avoid implementation issues. However, should you still encounter the same issue, kindly provide to us the exact sample project implementation you use to test the issue, screenshot of the issue for better illustration, and we will test it on our end.

 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

 

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002WwLfbQAF&entry.80707362=00094517

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 

Regards,

 

Google Logo
Michael Angelo
IMA SDK Team
 



ref:_00D1U1174p._5004Q2WwLfb:ref
Reply all
Reply to author
Forward
0 new messages