在Cordova \ Phonegap应用程序上播放带有VAST2.0的视频广告

时间:2014-09-06 17:13:49

标签: cordova mobile-website vast mobfox

我正在开发PhoneGap \ Cordova平台上的应用程序,并愿意整合MobFox视频广告。

我正在尝试播放视频广告,从MobFox广告服务器获取VAST 2.0 XML,但无法弄清楚如何...

测试广告网址:
http://my.mobfox.com/request.php?rt=api&r_type=video&r_resp_vast20&s=80187188f458cfde788d961b6882fd53&i=2.122.29.194&u=Mozilla/5.0%20%28iPhone;%20U;%20CPU%20iPhone%20OS%203_0%20like%20Mac%20OS%20X;%20en-us%29%20AppleWebKit/528.18%20%28KHTML,%20like%20Gecko%29%20Version/4.0%20Mobile/7A341%20Safari/528.16&o_iosadvid=68753A44-4D6F-1226-9C60-0050E4C00067

欢迎任何帮助或指导!

1 个答案:

答案 0 :(得分:0)

只需遵循MobFox官方指南,无需处理XML,只需调用API即可。请参阅android的示例代码:

mManager = new AdManager(this, "http://my.mobfox.com/request.php","ENTER_PUBLISHER_ID_HERE", true);
mManager.setListener(this);
mManager.setInterstitialAdsEnabled(true); //enabled by default. Allows the SDK to request static interstitial ads.
mManager.setVideoAdsEnabled(true); //disabled by default. Allows the SDK to request video fullscreen ads.
mManager.setPrioritizeVideoAds(true); //disabled by default. If enabled, indicates that SDK should request video ads first, and only if there is no video request an interstitial (if enabled)
mManager.requestAd();