Closed damjan25 closed 2 years ago
Ok looks like there is a better way to read the title, just add listener to loaded event and check ad obj
player.ima.addEventListener(EventType.LOADED, (ad) => {
console.log(ad.getAdData().title);
});
Does anyone know if this is also possible on returned object from player.ima.getAdsManager() ?
If not then this issue can be closed.
Based on the APIs available for the IMA Ads Manager, it does not seem to be possible to read the title without calling ad.getAdData()
. Using the LOADED
event is the recommended way to achieve this.
Closing the issue.
for example it can be done by this
player.ima.getAdsManager().l.h.title
This will return Tittle from the XML of the current ad loaded into IMA.Is there some more clean way to read it ? Because the problem here is that this letter after getAdsManager() is always changing (probably because of uglified code) player.ima.getAdsManager().h.g.title (used to be this) player.ima.getAdsManager().l.h.title (now it changed to this)
I see here in docs (https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.Ad#getTitle) that there is getTitle function, and that you are supposed to run it on google.ima.Ad.getTitle() but Ad object is not defined on google.ima object