|
@@ -15,9 +15,9 @@ class ADVideo {
|
|
|
/// 默认是加载成功的 啦
|
|
|
Global._adVideoState = ADVideoLoadState.success;
|
|
|
this.videoAd = videoAd;
|
|
|
-
|
|
|
videoAd.load()
|
|
|
.then(() => {
|
|
|
+ this.isFirstLoad = false;
|
|
|
Global._adVideoState = ADVideoLoadState.success;
|
|
|
GameEvent.fire(GameNotificationKey.AdUpdateStateNotification, ADVideoLoadState.success);
|
|
|
console.log('视频加载成功');
|
|
@@ -28,7 +28,8 @@ class ADVideo {
|
|
|
// } else {
|
|
|
// Global.commonAlert.showCommonErrorAlert('获取视频失败');
|
|
|
// }
|
|
|
- this.handelVideoErr(err, false);
|
|
|
+ this.handelVideoErr(err);
|
|
|
+ this.isFirstLoad = false;
|
|
|
});
|
|
|
|
|
|
// videoAd.onLoad(() => {
|
|
@@ -38,9 +39,9 @@ class ADVideo {
|
|
|
// console.log('视频加载成功');
|
|
|
// });
|
|
|
|
|
|
- //处理获取视频错误
|
|
|
+ // 处理获取视频错误
|
|
|
videoAd.onError( (res) => {
|
|
|
- this.handelVideoErr(res, true);
|
|
|
+ this.handelVideoErr(res);
|
|
|
});
|
|
|
|
|
|
|
|
@@ -81,15 +82,15 @@ class ADVideo {
|
|
|
Global.commonAlert.showCommonErrorAlert('视频正在播放请不要重复点击~~');
|
|
|
return;
|
|
|
} else {
|
|
|
- this.handelVideoErr(err, true);
|
|
|
+ this.handelVideoErr(err);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- handelVideoErr(res, isShow) {
|
|
|
- if (isShow) {
|
|
|
- Global.commonAlert.showCommonErrorAlert('获取视频失败');
|
|
|
- }
|
|
|
+ handelVideoErr(res) {
|
|
|
+ // if (isShow) {
|
|
|
+ // Global.commonAlert.showCommonErrorAlert('获取视频失败');
|
|
|
+ // }
|
|
|
Global._adVideoState = ADVideoLoadState.fail;
|
|
|
console.log('获取视频失败 fa' + res.errMsg);
|
|
|
GameEvent.fire(GameNotificationKey.AdUpdateStateNotification, ADVideoLoadState.fail);
|