|
@@ -438,11 +438,16 @@ export class SdkUtil {
|
|
|
}
|
|
|
else if(sys.platform==sys.Platform.WECHAT_GAME) {
|
|
|
call_back({"isEnded":true})
|
|
|
- // uiManager.Instance().showLoading()
|
|
|
- // if(SdkUtil.KS_GAME) {
|
|
|
+ // if(SdkUtil.KS_GAME) {
|
|
|
+ // uiManager.Instance().showLoading()
|
|
|
// SdkUtil.videoAd = ks.createRewardedVideoAd({adUnitId: _adUnitId});
|
|
|
- // } else {
|
|
|
- // SdkUtil.videoAd = wx.createRewardedVideoAd({adUnitId: _adUnitId});
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // console.log('wx ad')
|
|
|
+ // call_back({"isEnded":true})
|
|
|
+ // // gameManager.Singleton.showLoadingLevel()
|
|
|
+ // // SdkUtil.videoAd = wx.createRewardedVideoAd({adUnitId: _adUnitId});
|
|
|
+ // return
|
|
|
// }
|
|
|
}
|
|
|
else {
|
|
@@ -455,27 +460,36 @@ export class SdkUtil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ if(SdkUtil.KS_GAME) {
|
|
|
+ SdkUtil.videoAd.show().then(()=>{
|
|
|
+ console.log("ks 广告加载完成");
|
|
|
+ SdkUtil.isLookAd = true
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
SdkUtil.videoAd.onLoad(() => {
|
|
|
+ console.log("广告加载完成");
|
|
|
SdkUtil.isLookAd = true
|
|
|
SdkUtil.videoAd.show();
|
|
|
- console.log("广告加载完成");
|
|
|
});
|
|
|
SdkUtil.videoAd.onClose((res) => {
|
|
|
- // console.log('广告关闭')
|
|
|
+ console.log('广告关闭=',res)
|
|
|
uiManager.Instance().hideLoading()
|
|
|
SdkUtil.isLookAd = false
|
|
|
SdkUtil.videoAd.destroy()
|
|
|
call_back(res)
|
|
|
});
|
|
|
SdkUtil.videoAd.onError((res) => {
|
|
|
- // console.log('广告错误')
|
|
|
+ console.log('广告加载失败=',res)
|
|
|
uiManager.Instance().hideLoading()
|
|
|
- SdkUtil.isLookAd = false
|
|
|
- SdkUtil.videoAd.destroy()
|
|
|
let errorString = res.errCode + '-' + res.errMsg
|
|
|
call_back({isEnded:false,errorString:errorString})
|
|
|
+ SdkUtil.isLookAd = false
|
|
|
+ SdkUtil.videoAd.destroy()
|
|
|
});
|
|
|
- SdkUtil.videoAd.load()
|
|
|
+ if(sys.platform==sys.Platform.BYTEDANCE_MINI_GAME) {
|
|
|
+ SdkUtil.videoAd.load()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//------------------------------ 微信相关 ------------------------------//
|