| | |
| | | import android.content.res.Configuration; |
| | | import android.database.Cursor; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.annotation.NonNull; |
| | |
| | | return; |
| | | //加载广告 |
| | | if (BeibeiConstant.AD_TYPE.isVideoDetailSplashAd()) { |
| | | |
| | | //判断加载广告的类型 |
| | | |
| | | int fullvideo = adInfo.getFullVideoWeight(); |
| | | int interstitial = adInfo.getInterstitialWeight(); |
| | | int random = (int) ((fullvideo + interstitial) * Math.random()); |
| | | if (random <= fullvideo) { |
| | | if (FullVideoAdManager.getInstance().isCacahed()) { |
| | | FullVideoAdManager.getInstance().showAd(this); |
| | | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT_WATCH) { |
| | | int fullvideo = adInfo.getFullVideoWeight(); |
| | | int interstitial = adInfo.getInterstitialWeight(); |
| | | int random = (int) ((fullvideo + interstitial) * Math.random()); |
| | | if (random <= fullvideo) { |
| | | if (FullVideoAdManager.getInstance().isCacahed()) { |
| | | FullVideoAdManager.getInstance().showAd(this); |
| | | } else { |
| | | FullVideoAdManager.getInstance().loadAd(VideoDetailActivity2.this, new FullVideoAdManager.IFullVideoAdListener() { |
| | | @Override |
| | | public void onSuccess(TTFullScreenVideoAd ad) { |
| | | FullVideoAdManager.getInstance().showAd(VideoDetailActivity2.this); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | FullVideoAdManager.getInstance().loadAd(BeibeiVideoApplication.application, new FullVideoAdManager.IFullVideoAdListener() { |
| | | @Override |
| | | public void onSuccess(TTFullScreenVideoAd ad) { |
| | | FullVideoAdManager.getInstance().showAd(VideoDetailActivity2.this); |
| | | } |
| | | }); |
| | | showInterstitialAd(); |
| | | } |
| | | } else { |
| | | showInterstitialAd(); |
| | | FullVideoAdManager.getInstance().loadGDT(VideoDetailActivity2.this, null); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | protected void onDestroy() { |
| | | if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isVideoDetailSplashAd()) |
| | | FullVideoAdManager.getInstance().loadAd(BeibeiVideoApplication.application, null); |
| | | FullVideoAdManager.getInstance().loadAd(VideoDetailActivity2.this, null); |
| | | uploadSession(); |
| | | GoldCornUtil.removeCallbacks(fl_video_play_background, makeGoldCornRunnable); |
| | | //屏幕常亮 |