| | |
| | | import com.qq.e.ads.nativ.express2.VideoOption2; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.weikou.beibeivideo.entity.ad.ExpressAdContainer; |
| | | import com.weikou.beibeivideo.ui.recommend.SearchActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | |
| | |
| | | } else if (sourceType == AdUtil.AD_TYPE.gdt2) { |
| | | pid = GDTConstant.PID_2_VIDEO_DETAIL_PLAY_EXPRESS1; |
| | | } |
| | | if (mContext == null) |
| | | return; |
| | | //获取屏幕的宽 |
| | | int deviceWidth = DimenUtils.getScreenWidth(mContext); |
| | | deviceWidth = DimenUtils.px2dip(mContext, deviceWidth); |
| | |
| | | |
| | | |
| | | /** |
| | | * 加载视频搜索广告 |
| | | * |
| | | * @param adLoadListener |
| | | */ |
| | | public void loadSearchAd(int widthDP, final IAdLoadListener adLoadListener) { |
| | | //加载大图 |
| | | String pid = null; |
| | | if (sourceType == AdUtil.AD_TYPE.csj) { |
| | | pid = CSJConstant.VIDEO_SEARCH; |
| | | } else if (sourceType == AdUtil.AD_TYPE.gdt) { |
| | | pid = BeibeiConstant.GDT_SEARCH_NATIVE; |
| | | } |
| | | int height = (int) (widthDP / 1.78f); |
| | | |
| | | loadAd(widthDP, height, pid, 1, adLoadListener); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 加载广点通广告 |
| | | * |
| | | * @param positionId |
| | |
| | | * @param context |
| | | */ |
| | | private void loadGDT(String positionId, int widthDP, int heightDP, int count, final IGDTAdLoadListener adLoadListener, Context context) { |
| | | |
| | | |
| | | NativeExpressAD nativeExpressAD = new NativeExpressAD(context, new ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), |
| | | positionId, new NativeExpressAD.NativeExpressADListener() { |
| | | |