How can I change adTagUrl using API?

We can set adTagUrl when we construct the video player. How can I change it afterwards. Like after one video finishes playing, it rolls to another, instead of playing the same video ad tag, I want to play a different one. How can I change adTagUrl using API functions?

Thanks!

Jim

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]"); }); },

Thanks!

I find that adTagUrl can be changed during the video.