屏蔽视频广告
This commit is contained in:
parent
6ccdcd983a
commit
b170de975d
@ -387,19 +387,7 @@
|
|||||||
this.uid = value;
|
this.uid = value;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} 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() {
|
mounted: function mounted() {
|
||||||
// this.title = '第' + 1 + '集'
|
// this.title = '第' + 1 + '集'
|
||||||
@ -414,18 +402,7 @@
|
|||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
timeupdate: function (e) {
|
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) {
|
progress(e) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user