提交 cade7b9c 编写于 作者: d-u-a's avatar d-u-a

docs: ad

上级 16cc4b79
......@@ -85,7 +85,7 @@
// AD.load(this._adpid)
},
methods: {
show() {
showAd() {
AD.show(this._adpid, (res) => {
console.log("onclose")
console.log(res)
......@@ -178,12 +178,15 @@ const ProviderType = {
GDT: 'gdt'
}
const RETRY_COUNT = 1
class RewardedVideo {
constructor(options = {}) {
this._isLoad = false
this._isLoading = false
this._lastLoadTime = 0
this._lastError = null
this._retryCount = 0
this._loadCallback = null
this._closeCallback = null
......@@ -201,10 +204,8 @@ class RewardedVideo {
this._isLoad = false
this.onClose(e)
})
rewardAd.onVerify && rewardAd.onVerify((e) => {
// this._dispatchEvent('verify', {
// isValid: e.isValid
// })
rewardAd.onVerify((e) => {
// e.isValid
})
rewardAd.onError(({
code,
......@@ -221,8 +222,13 @@ class RewardedVideo {
return
}
this._lastError = data
if (this._retryCount < RETRY_COUNT) {
this._retryCount += 1
this._loadAd()
return
}
this._lastError = data
this.onError(data)
})
}
......@@ -252,6 +258,8 @@ class RewardedVideo {
return
}
this._retryCount = 0
this._loadAd()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册