| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.os.Build; |
| | | import android.util.Log; |
| | | import android.widget.Toast; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | |
| | | int w = DimenUtils.getScreenWidth(context); |
| | | int h = DimenUtils.getScreenHeight(context); |
| | | String channel = AndroidManifestUtil.getChannel(context); |
| | | String pid = "945393854"; |
| | | String pid =AndroidManifestUtil.isVIVOChannel(context)?CSJConstant.VIDEO_DETAIL_INTERSTITIALAD_VIVO : CSJConstant.VIDEO_DETAIL_INTERSTITIALAD; |
| | | if ("huawei".equalsIgnoreCase(channel)) { |
| | | pid = "948943768"; |
| | | } |
| | |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId(pid) |
| | | .setSupportDeepLink(true) |
| | | .setExpressViewAcceptedSize(w, h) |
| | | .setExpressViewAcceptedSize(200, 300) |
| | | .setOrientation(TTAdConstant.VERTICAL) |
| | | .build(); |
| | | TTAdManager ttAdManager = null; |
| | |
| | | mTTAdNative.loadFullScreenVideoAd(adSlot, new TTAdNative.FullScreenVideoAdListener() { |
| | | @Override |
| | | public void onError(int code, String message) { |
| | | Log.i("loadFullScreenVideoAd","onError"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | }); |
| | | |
| | | if (ad != null && adListener != null) |
| | | if (adListener != null) |
| | | adListener.onSuccess(ad); |
| | | } |
| | | |