Quantcast
Channel: Kaltura - Latest posts
Viewing all articles
Browse latest Browse all 7410

How can I change adTagUrl using API?

$
0
0

You can change the adTagURL after the movie starts. However it will apply only for the next movie (when using a playlist) as the adTag configuration is read only once per video (when it first loads). The following code demonstrates how to change the adTagUrl when changing media (for example when you click on another video on a playlist). The code is added in the embed code readyCallback block:

'readyCallback': function(playerId){
var kdp = document.getElementById(playerId);
kdp.kBind("onChangeMedia", function(){
kdp.setKDPAttribute("doubleClick","adTagUrl","http://pubads.g.doubleclick.net/gampad/ads?sz=640x360&iu=/6062/iab_vast_samples/skippable&ciu_szs=300x250,728x90&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]");
});
},


Viewing all articles
Browse latest Browse all 7410

Trending Articles