展示视频广告
[!TIP|labelVisibility:hidden|iconVisibility:hidden] navigator.adview.showVideoAd(success, error,options)
支持平台:
- Android
- iOS
参数说明
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
success | Function | 是 | 成功回调函数 |
error | Function | 是 | 失败回调函数 |
options | Object | 是 | 参数对象 |
success
函数没有返回,直接加载广告
error
函数会返回一个字符串,错误的相关信息
options
参数为一个对象,其属性包含以下一项或多项:
positionID
(String/ 必选) -- 视频广告位ID,在adview官网开发者后台申请
示例代码
// 引用js
<script src='supconit://hcmobile.js'></script>
<script>
// 监听’deviceready‘事件
document.addEventListener('deviceready', onDeviceReady, false)
function onDeviceReady(){
navigator.adview.showVideoAd(function (success) {
console.log(JSON.stringify(success));
},function (error){
alert(JSON.stringify(error));
},{'positionID':'POSID74pjtjpxo516'});
}
</script>