Commit 1203888e authored by wangxuewei's avatar wangxuewei

Merge remote-tracking branch 'origin/develop_1.0.6' into develop_1.0.6

parents b497afab 783a82c4
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -32,7 +32,7 @@ class BaseApplication : MultiDexApplication() {
//第一步初始化 application
AppliContext.init(this)
// Config.init(this)
NetConfig.setBase_Url(NetConfig.Environment.DEV)// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
NetConfig.setBase_Url(NetConfig.Environment.PRODUCT)// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
Constant.appLs = "a03d5320d905cf3b"//applsq
AdManager.init(this)
......
......@@ -551,10 +551,10 @@ object AdManager {
var callback: ZXADCallback = object : ZXADCallback {
override fun onAdSuccess() {
Log.d(TAG, "onAdSuccess")
Log.d(
"mingzhong",
"Success adPlatform" + newsEntity.adPlatform + " platformId" + newsEntity.platformId
);
// Log.d(
// "mingzhong",
// "Success adPlatform" + totalEntity[0].adPlatform + " platformId" + totalEntity[0].platformId
// );
result.remove(newsEntity)
AdCache.rewardList.put(slotName, result)
Utils.showToast(mActivity, "看完视频即可获得奖励")
......@@ -562,15 +562,20 @@ object AdManager {
}
override fun onAdFail() {
Log.d(TAG, "onAdFail totalEntity.size" + totalEntity.size)
Log.d("mingzhong", "onAdFail totalEntity.size" + totalEntity.size)
AdCache.rewardList.put(slotName, totalEntity)
if (totalEntity.size > 0) {
// Log.d(
// "mingzhong",
// "Fail adPlatform" + totalEntity[0].adPlatform + " platformId" + totalEntity[0].platformId
// );
var newsEntitys = totalEntity[0]
loadVideoAd(mActivity, newsEntitys, listener, this)
Log.d(
"mingzhong",
"Fail adPlatform" + newsEntitys.adPlatform + " platformId" + newsEntitys.platformId
);
totalEntity.removeAt(0)
// AdCache.rewardList.put(slotName,result)
}
......@@ -579,6 +584,7 @@ object AdManager {
loadVideoAd(mActivity, totalEntity[0], listener, callback)
totalEntity.removeAt(0)
AdCache.rewardList.put(slotName, totalEntity)
listener.onSuccess()
}
......
......@@ -468,27 +468,30 @@ object TTADUtils {
.setMediaExtra("media_extra") //用户透传的信息,可不传
.build()
var mttRewardVideoAd:TTRewardVideoAd? = null
mTTAdNative.loadRewardVideoAd(adSlot, object : RewardVideoAdListener {
override fun onError(code: Int, message: String) {
EventUtils.onEventPullFail(entity)
listener.onError()
callback.onAdFail()
Log.e("mingzhong",""+code+" "+message +" platformId:"+entity.platformId)
}
//视频广告加载后的视频文件资源缓存到本地的回调
override fun onRewardVideoCached() {
listener.onRewardVideoCached()
override fun onRewardVideoAdLoad(ad: TTRewardVideoAd) {
// listener.onRewardVideoCached()
Log.e("mingzhong","onRewardVideoCached")
mttRewardVideoAd = ad
}
//视频广告素材加载到,如title,视频url等,不包括视频文件
override fun onRewardVideoAdLoad(ad: TTRewardVideoAd) {
override fun onRewardVideoCached() {
Log.e("mingzhong","onRewardVideoAdLoad")
EventUtils.onEventPullSuccess(entity)
callback.onAdSuccess()
// var mttRewardVideoAd = ad
var mttRewardVideoAd = ad
mttRewardVideoAd.setRewardAdInteractionListener(object :
mttRewardVideoAd?.setRewardAdInteractionListener(object :
RewardAdInteractionListener {
override fun onAdShow() {
listener.setRewardAdInteractionListener()
......@@ -531,7 +534,7 @@ object TTADUtils {
listener.onSkippedVideo()
}
})
mttRewardVideoAd.setDownloadListener(object : TTAppDownloadListener {
mttRewardVideoAd?.setDownloadListener(object : TTAppDownloadListener {
override fun onIdle() {}
override fun onDownloadActive(
totalBytes: Long,
......@@ -573,10 +576,9 @@ object TTADUtils {
) {
}
})
Log.e(TAG,"穿山甲激励视频耗时"+ (System.currentTimeMillis()-startTime)+"")
listener.onRewardVideoAdLoad(entity)
mttRewardVideoAd.showRewardVideoAd(activity)
mttRewardVideoAd?.showRewardVideoAd(activity)
}
})
}
......
......@@ -29,6 +29,7 @@ import com.ym.library.module.NewsEntity
import com.ym.library.utils.EventUtils
import com.ym.library.utils.EventUtils.onEventClick
import com.ym.library.utils.EventUtils.onEventUM
import kotlin.math.log
object GDTAdUtils {
......@@ -310,6 +311,7 @@ object GDTAdUtils {
override fun onError(p0: AdError?) {
EventUtils.onEventPullFail(entity)
Log.e("huang",p0?.errorMsg+"" +p0?.errorCode)
listener.onVideoError()
callback.onAdFail()
}
......
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