Commit b9fb057f authored by mengcuiguang's avatar mengcuiguang

视频权重优化

parent 13f26067
......@@ -92,17 +92,6 @@ public class VedioAdingManager {
loadAdVedio(getVedioAdType(), bean);
}
/**
* 根据类型加载对应视频(第一次加载)
*
* @param bean
*/
public void loadAding(Activity activity, VedioAdingBean bean, int i) {
this.activity = activity;
isVedioAdDownload = false;
loadAdVedio(Constant.FL_VEDIO_AD, bean);
}
/**
* 加载失败优先级对应视频
*
......@@ -116,19 +105,15 @@ public class VedioAdingManager {
/**
* 根据广告优先级获取下一个
* <p>
* 穿山甲激励> 优量汇>闪电盒子> 珊瑚>创神>mintegral>全屏>多盟>东方网
*/
private String getNextAdType() {
String nextAdType = "";
if (AppConfig.csjVedioAdCount > 0) {
nextAdType = Constant.CSJ_VEDIO_AD;
} else if (AppConfig.flVedioAdCount > 0) {
nextAdType = Constant.FL_VEDIO_AD;
} else if (AppConfig.ylhAdCount > 0) {
nextAdType = Constant.YLH_VEDIO_AD;
} else {
nextAdType = Constant.SDHZ_VEDIO_AD;
nextAdType = Constant.FL_VEDIO_AD;
}
return nextAdType;
}
......@@ -156,7 +141,6 @@ public class VedioAdingManager {
int weight = 0;
// 若没有视频完成数,不加入权重计算范围内
// 穿山甲激励> 优量汇
if (AppConfig.wnVedioAdCount > 0) {
weightList.add(new WeightBean(wnWeight, Constant.SDHZ_VEDIO_AD));
weight = weight + wnWeight;
......
......@@ -491,14 +491,16 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 设置视频权重
*/
private fun initAdWeight(data: UserTaskMsgBean) {
// vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate)
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate}")
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate}" +
" sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}")
// 广告视频数
AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount}")
AppConfig.flVedioAdCount = data.vedioRules.fL_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount}" +
" sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount}")
}
......
......@@ -872,13 +872,14 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
* 设置视频权重
*/
private fun initAdWeight(data: UserTaskMsgBean) {
vedioAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate)
// vedioAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate)
// vedioAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate)
vedioAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}")
// 广告视频数
AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
AppConfig.flVedioAdCount = data.vedioRules.fL_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount}")
}
}
\ No newline at end of file
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