This will help you to get vast Markup (XML) in string format for video player Adspot where developers have their own players to play video Ads.
The below snippet shows the example of requesting Vast MarkUp Ads.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
// Initialize the adview object with proper adspot id and ux type and then call // CacheAd() api. VMAXAdView adView = new VMAXAdView(); adView.AdspotId = "MY_ADSPOT_ID"; adView.UX= AdUX.Interstitial; adView.CacheAd(); //Once ad has been caached successfully, initialize the VastAdObject as follows. private void AdView_AdCached(object sender, EventArgs e) { VastAdObject adobj = adView.vastAdObject; if(adobj != null) { string str = adobj.GetVastResponse(); } } |