Resend AD request with "onLoad" requestMode
See original GitHub issueI’m trying to do some waterfall model with using two ad_tags, with reloading I’m trying to do it in that way:
let adConfig = {
requestMode: "onLoad",
adTagUrl: "FIRST_URL";
}
this.player.ima (adConfig);
............
player.on ('adserror', (event) => {
this.player.ima.initializeAdDisplayContainer ();
this.player.ima.setContentWithAdTag (null, "SECOND_URL", true);
this.player.ima.requestAds ();
});
Using “onPlay” requestMode everything is fine, when click play, player try to load “FIRST_URL”, and if for example when ADError: 1009 was happen, it send request to SECOND_URL, and plays the ads from second tag without problems
But when the requestMode is set to “onLoad” (to prefetch the ads), If any aderror was triggered, even if the SECOND_URL ad tag is requested, and downloaded properly, videojs-ima doesn’t play te ads from the SECOND_URL. It simply starts my video without any errors in console
If I add the play ()
function directly after the this.player.ima.requestAds ();
, or I have an autoplay in my player, it works fine, so that could be related to some timeouts?
Maybe it will be an option to reload whole videojs-ima plugin for that? How to achieve it?
And another simple question. Is it posible to get an AD XML content from the plugin code?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Hello @komw ,
I was able to reproduce the behavior you are seeing, where the 2nd ad does not load if
requestMode
is let to"onLoad"
.I will plan into looking into a built in solution, but for now the work-arounds you suggested seem to work.
In terms of the xml returned by the ad request, the plugin does not provide a way to view this, however, you should be able to see what is returned in the network tab of the browser developer console.
Thank you, Jackson IMA SDK DevRel
Hi @Kiro705 Yes, we tried the preloading for adsRenderingSettings without success. Do you have opportunity to check what is going on with that bug?