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

fix: ad preload

上级 e37c6459
......@@ -64,23 +64,20 @@ class AdEventHandler {
}
class AdBase extends AdEventHandler {
private _isLoaded: boolean = false
preload: boolean = true
private _isLoaded: boolean = false
private _isLoading: boolean = false
private _preload: boolean = true
private _loadPromiseResolve: Function | null = null
private _loadPromiseReject: Function | null = null
private _showPromiseResolve: Function | null = null
private _showPromiseReject: Function | null = null
private _adInstance: any
constructor(adInstance: any, options: any) {
super()
this._preload = options.preload !== undefined ? options.preload : false
this.preload = options.preload !== undefined ? options.preload : false
const ad = (this._adInstance = adInstance)
......@@ -105,7 +102,7 @@ class AdBase extends AdEventHandler {
this._isLoading = false
this._dispatchEvent(EventType.close, e)
if (this._preload === true) {
if (this.preload === true) {
this._loadAd()
}
})
......
......@@ -14,6 +14,7 @@ class FullScreenVideoAd
{
constructor(options: any) {
super(plus.ad.createFullScreenVideoAd(options), options)
this.preload = false
}
}
......
......@@ -11,7 +11,7 @@ import { AdBase } from './adBase'
class InterstitialAd extends AdBase implements UniApp.InterstitialAdContext {
constructor(options: any) {
super(plus.ad.createInterstitialAd(options), options)
this.preload = false
this._loadAd()
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册