Commit b1746c8e authored by maxiaoliang's avatar maxiaoliang

盲盒

parent 2b5e6742
...@@ -34,8 +34,8 @@ object CSJAdManager { ...@@ -34,8 +34,8 @@ object CSJAdManager {
} }
fun adInit(context: Context, appId: String, initCallback: TTAdSdk.InitCallback?) { fun adInit(context: Context, appId: String, initCallback: TTAdSdk.InitCallback?) {
TTAdManagerHolder.init(context, appId, initCallback) // TTAdManagerHolder.init(context, appId, initCallback)
//TTAdManagerHolder.init(context, "5335826", initCallback) TTAdManagerHolder.init(context, "5335826", initCallback)
} }
private var splashAd: TTSplashAd? = null private var splashAd: TTSplashAd? = null
...@@ -156,11 +156,11 @@ object CSJAdManager { ...@@ -156,11 +156,11 @@ object CSJAdManager {
// // .setExpressViewAcceptedSize(300f, 300f) //期望模板广告view的size,单位dp // // .setExpressViewAcceptedSize(300f, 300f) //期望模板广告view的size,单位dp
// .setAdLoadType(TTAdLoadType.LOAD) //推荐使用,用于标注此次的广告请求用途为预加载(当做缓存)还是实时加载,方便后续为开发者优化相关策略 // .setAdLoadType(TTAdLoadType.LOAD) //推荐使用,用于标注此次的广告请求用途为预加载(当做缓存)还是实时加载,方便后续为开发者优化相关策略
// .build() // .build()
//step4:创建广告请求参数AdSlot,具体参数含义参考文档
val adSlot = AdSlot.Builder() val adSlot = AdSlot.Builder()
.setCodeId(entity.codeId) //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD //.setCodeId(entity.codeId)
// .setCodeId("949814576") //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD .setCodeId("949817040")
// .setImageAcceptedSize(1080, 1920)
// .setExpressViewAcceptedSize(350f,300f)
.setAdLoadType(TTAdLoadType.LOAD) .setAdLoadType(TTAdLoadType.LOAD)
.build() .build()
mTTAdNative?.loadFullScreenVideoAd(adSlot, object : TTAdNative.FullScreenVideoAdListener { mTTAdNative?.loadFullScreenVideoAd(adSlot, object : TTAdNative.FullScreenVideoAdListener {
...@@ -195,7 +195,7 @@ object CSJAdManager { ...@@ -195,7 +195,7 @@ object CSJAdManager {
//该方法直接展示广告 //该方法直接展示广告
//mttFullVideoAd.showFullScreenVideoAd(FullScreenVideoActivity.this); //mttFullVideoAd.showFullScreenVideoAd(FullScreenVideoActivity.this);
innterstitialAd?.showFullScreenVideoAd(context,TTAdConstant.RitScenes.GAME_GIFT_BONUS, null) innterstitialAd?.showFullScreenVideoAd(context)
innterstitialAd = null innterstitialAd = null
innterstitialAd?.setFullScreenVideoAdInteractionListener(object : innterstitialAd?.setFullScreenVideoAdInteractionListener(object :
TTFullScreenVideoAd.FullScreenVideoAdInteractionListener { TTFullScreenVideoAd.FullScreenVideoAdInteractionListener {
...@@ -219,17 +219,6 @@ object CSJAdManager { ...@@ -219,17 +219,6 @@ object CSJAdManager {
override fun onSkippedVideo() { override fun onSkippedVideo() {
} }
// override fun onAdClicked() {
//
// }
//
// override fun onAdShow() {
//
// }
//
// override fun onAdDismiss() {
//
// }
}) })
......
...@@ -70,7 +70,7 @@ public class TTAdManagerHolder { ...@@ -70,7 +70,7 @@ public class TTAdManagerHolder {
private static TTAdConfig buildConfig(Context context,String appId) { private static TTAdConfig buildConfig(Context context,String appId) {
return new TTAdConfig.Builder() return new TTAdConfig.Builder()
.appId(appId) .appId("5335826")
.useTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView .useTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
.allowShowNotify(true) //是否允许sdk展示通知栏提示 .allowShowNotify(true) //是否允许sdk展示通知栏提示
.debug(false) //测试阶段打开,可以通过日志排查问题,上线时去除该调用 .debug(false) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment