屏蔽视频广告

This commit is contained in:
zby 2022-12-29 08:56:56 +08:00
parent 6ccdcd983a
commit b170de975d

View File

@ -387,19 +387,7 @@
this.uid = value;
}
} catch (e) {}
// 在页面onLoad回调事件中创建插屏广告实例
if (wx.createInterstitialAd) {
this.interstitialAd = wx.createInterstitialAd({
adUnitId: 'adunit-4e9e95b202421a08'
});
this.interstitialAd.onLoad(() => {});
this.interstitialAd.onError(err => {
console.log(err);
});
this.interstitialAd.onClose(() => {
uni.createVideoContext(`video${this.current}`, this).play();
});
}
},
mounted: function mounted() {
// this.title = '第' + 1 + '集'
@ -414,18 +402,7 @@
return;
},
timeupdate: function (e) {
const time = parseInt(e.detail.currentTime);
const row = this.list[this.current];
if (row.order < 10 && (time === 20 || time === 60)) {
setTimeout(() => {
this.interstitialAd
.show()
.then(() => {
uni.createVideoContext(`video${this.current}`, this).pause();
})
.catch(err => {});
}, 1000);
}
},
progress(e) {