I created a Ad unit for video in Google AdManager. Manual is here: https://support.google.com/admanager/answer/1181016?hl=en. I used generated AdTagUrl in my Radiant Player (I want to use it for video advertisement included to article). Manual is here: https://www.radiantmediaplayer.com/docs/latest/outstream-video-ads.html. It's working OK. But only when AdManager sends a creative. When AdManager sends no creative, I must hide the player.
Is there a way to detect, if AdManager sends a creative before loading the player?
For example something like:
function showOutstreamVideo()
{
//detect if there is an advertisement
var x = new XMLHttpRequest();
x.open("GET", AdTagUrl, true);
x.onreadystatechange = function () {
if (x.readyState == 4 && x.status == 200)
{
var vast = x.responseXML;
if(vast.getElementsByTagName("Ad").length>0)
{ //code for read, init and place player
}
}
}
...but I cannot init Radiant Player with this vast object. And when I use adTagUrl again, for AdManager it'll be second impression, that can be different. Is there a solution to prevent the page from unnecessarily requesting the player script, when there is no creative?
Thanks and sorry for my English
Have you tried loading the Radiant Player dynamically?