1.问题

2. 激励视频使用及解决方案
官方文档
let videoAd = null;
Page({
data: {},
onLoad(options) {
let that = this;
if (wx.createRewardedVideoAd) {
videoAd = wx.createRewardedVideoAd({
adUnitId: 'xxx',
});
try {
if (videoAd.closeHandler) {
videoAd.offClose(videoAd.closeHandler);
}
} catch (e) {
console.error(e);
}
videoAd.closeHandler = function (res) {
if ((res && res.isEnded) || res === undefined) {
console.log('正常播放完成',res)
} else {
console.log('中途退出', res);
}
};
videoAd.onClose(videoAd.closeHandler);
}
},
onShowVideo() {
if (videoAd) {
videoAd.show().catch((err) => {
videoAd
.load()
.then(() => videoAd.show())
.catch((err) => {
console.error('激励视频 广告显示失败', err);
});
});
}
},
});