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

update: 激励视频广告支持新增的服务器回调参数

上级 76085e3c
......@@ -8,11 +8,7 @@ const eventNames = [
const ERROR_CODE_LIST = [-5001, -5002, -5003, -5004, -5005, -5006]
class RewardedVideoAd {
constructor (adpid) {
this._options = {
adpid: adpid
}
constructor (options = {}) {
const _callbacks = this._callbacks = {}
eventNames.forEach(item => {
_callbacks[item] = []
......@@ -26,7 +22,7 @@ class RewardedVideoAd {
this._adError = ''
this._loadPromiseResolve = null
this._loadPromiseReject = null
const rewardAd = this._rewardAd = plus.ad.createRewardedVideoAd(this._options)
const rewardAd = this._rewardAd = plus.ad.createRewardedVideoAd(options)
rewardAd.onLoad((e) => {
this._isLoad = true
this._dispatchEvent('load', {})
......@@ -85,8 +81,6 @@ class RewardedVideoAd {
}
}
export function createRewardedVideoAd ({
adpid = ''
} = {}) {
return new RewardedVideoAd(adpid)
export function createRewardedVideoAd (options) {
return new RewardedVideoAd(options)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册