| | |
| | | android:largeHeap="true" |
| | | android:theme="@style/AppTheme" |
| | | android:usesCleartextTraffic="true" |
| | | android:extractNativeLibs="true" |
| | | android:debuggable="false" |
| | | tools:replace="android:allowBackup"> |
| | | |
| | |
| | | android:value="570f28a578d6e12cba6f7f200b8d1c83"></meta-data> |
| | | <meta-data |
| | | android:name="UMENG_CHANNEL" |
| | | android:value="oppo"></meta-data> |
| | | android:value="huawei"></meta-data> |
| | | |
| | | |
| | | <provider |
| | |
| | | implementation files('libs/nb_trade-4.0.0.27.aar') |
| | | implementation files('libs/nb_trade-4.0.0.27.aar') |
| | | implementation files('libs/open_ad_6.1.7.2_841bfa881_2394g.aar') |
| | | implementation files('libs/open_ad_sdk_6.8.1.7.aar') |
| | | |
| | | |
| | | implementation 'androidx.cardview:cardview:1.0.0' |
| | |
| | | // } |
| | | // implementation('com.volcengine:apm_insight_crash:1.4.2') |
| | | // implementation('com.volcengine:apm_insight_sdk:1.0.3') |
| | | implementation 'com.pangle.cn:mediation-sdk:6.6.0.7' |
| | | implementation ('com.pangle.cn:pangrowth-dpsdk:5.2.1.0'){ |
| | | // implementation 'com.pangle.cn:mediation-sdk:6.6.0.7' |
| | | |
| | | |
| | | implementation('com.pangle.cn:pangrowth-dpsdk:5.2.1.0') { |
| | | exclude group: 'com.pangle.cn', module: 'adclog' |
| | | } |
| | | implementation 'com.pangle.cn:pangrowth-base:2.7.0.0' |
| | |
| | | implementation 'com.apkfuns.log2file:log2file:1.3.1' |
| | | |
| | | implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.10" |
| | | |
| | | |
| | | } |
| | | android { |
| | | signingConfigs { |
| | |
| | | useLibrary 'org.apache.http.legacy' |
| | | compileSdkVersion 29 |
| | | buildToolsVersion '29.0.2' |
| | | |
| | | compileOptions { |
| | | sourceCompatibility JavaVersion.VERSION_1_7 |
| | | targetCompatibility JavaVersion.VERSION_1_7 |
| | |
| | | |
| | | defaultConfig { |
| | | applicationId "com.doudou.ysvideo" |
| | | versionCode 153 |
| | | versionName "3.11.2" |
| | | versionCode 154 |
| | | versionName "3.11.3" |
| | | multiDexEnabled = true |
| | | minSdkVersion 21 |
| | | minSdkVersion 24 |
| | | targetSdkVersion 30 |
| | | ndk { |
| | | // 32与64 |
| | |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_user_agreement_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginLeft="6.5dp" |
| | |
| | | android:textColor="#F4DE4A" |
| | | android:textSize="17sp" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center_vertical" |
| | | android:layout_marginTop="8dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <CheckBox |
| | | android:visibility="visible" |
| | | android:id="@+id/cb_user_agreement" |
| | | android:layout_width="15dp" |
| | | android:layout_height="15dp" |
| | | android:layout_gravity="center_vertical" |
| | | android:background="@drawable/selector_user_agreement_checkbox" |
| | | android:button="@null" |
| | | android:checked="false" |
| | | android:gravity="center" /> |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_user_agreement_click" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="6.5dp" |
| | | android:text="勾选即代表同意" |
| | | android:textColor="@color/login_protocol_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_user_agreement" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@string/user_agreement" |
| | | android:textColor="@color/login_protocol_highlight_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="、" |
| | | android:textColor="@color/login_protocol_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_privacy_policy" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@string/privacy_policy" |
| | | android:textColor="@color/login_protocol_highlight_text_color" |
| | | android:textSize="11sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </ScrollView> |
| | | |
| | |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_user_agreement_click" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="6.5dp" |
| | |
| | | <resources> |
| | | <string name="app_name">影视大全</string> |
| | | <string name="app_name">影视大全韩剧</string> |
| | | <string name="recommend">视频</string> |
| | | <string name="category">分类</string> |
| | | <string name="discover">发现</string> |
| | |
| | | import com.apkfuns.logutils.LogUtils; |
| | | import com.bytedance.sdk.djx.DJXSdk; |
| | | import com.bytedance.sdk.djx.DJXSdkConfig; |
| | | import com.bytedance.sdk.djx.IDJXPrivacyController; |
| | | import com.bytedance.sdk.djx.model.DJXError; |
| | | import com.bytedance.sdk.dp.DPSdk; |
| | | import com.bytedance.sdk.dp.DPSdkConfig; |
| | |
| | | |
| | | public static void initDJ(Application application){ |
| | | try{ |
| | | DJXSdk.init(application, "SDK_Setting_5095354.json", new DJXSdkConfig.Builder().debug(true).build()); |
| | | |
| | | DJXSdk.init(application, "SDK_Setting_5095354.json", new DJXSdkConfig.Builder().privacyController(new IDJXPrivacyController() { |
| | | @Override |
| | | public boolean isOnlyICPNumber() { |
| | | return true; |
| | | } |
| | | }).debug(true).build()); |
| | | DJXSdk.start(new DJXSdk.StartListener() { |
| | | @Override |
| | | public void onStartComplete(boolean b, String s, @Nullable DJXError djxError) { |
| | |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.view.View; |
| | | import android.widget.CheckBox; |
| | | import android.widget.EditText; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | |
| | | private TextView tv_obtain_verfication_code; |
| | | private EditText et_pwd; |
| | | private TextView tv_confirm; |
| | | private CheckBox cb_user_agreement; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle arg0) { |
| | |
| | | tv_obtain_verfication_code = (TextView) findViewById(R.id.tv_obtain_verfication_code); |
| | | et_pwd = (EditText) findViewById(R.id.et_pwd); |
| | | tv_confirm = (TextView) findViewById(R.id.tv_confirm); |
| | | cb_user_agreement = findViewById(R.id.cb_user_agreement); |
| | | tv_obtain_verfication_code.setOnClickListener(this); |
| | | tv_confirm.setOnClickListener(this); |
| | | findViewById(R.id.tv_back).setOnClickListener(this); |
| | | findViewById(R.id.tv_user_agreement_click).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | cb_user_agreement.setChecked(!cb_user_agreement.isChecked()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | switch (v.getId()) { |
| | | case R.id.tv_obtain_verfication_code: |
| | | case R.id.tv_obtain_verfication_code: { |
| | | String email = et_email.getText().toString(); |
| | | if (StringUtils.isEmpty(email)) { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "请先输入邮箱号"); |
| | | return; |
| | | } else { |
| | | Matcher m = IsEmail.isEmailAddress().matcher(email); |
| | | if (m.matches()) { |
| | | getVerficationCode(email); |
| | | } else { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "输入的邮箱账号有误,请查证!"); |
| | | return; |
| | | } |
| | | } |
| | | break; |
| | | case R.id.tv_confirm: |
| | | if (!cb_user_agreement.isChecked()) { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "请同意《用户使用协议》与《隐私政策》"); |
| | | return; |
| | | } |
| | | Matcher m = IsEmail.isEmailAddress().matcher(email); |
| | | if (m.matches()) { |
| | | getVerficationCode(email); |
| | | } else { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "输入的邮箱账号有误,请查证!"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | break; |
| | | case R.id.tv_confirm: { |
| | | String str = et_email.getText().toString(); |
| | | if (StringUtils.isEmpty(str)) { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "请先输入邮箱号"); |
| | | return; |
| | | } else { |
| | | Matcher m = IsEmail.isEmailAddress().matcher(str); |
| | | if (!m.matches()) { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "输入的邮箱账号有误,请查证!"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (!cb_user_agreement.isChecked()) { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "请同意《用户使用协议》与《隐私政策》"); |
| | | return; |
| | | } |
| | | |
| | | Matcher m = IsEmail.isEmailAddress().matcher(str); |
| | | if (!m.matches()) { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "输入的邮箱账号有误,请查证!"); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(et_pwd.getText().toString())) { |
| | | SingleToast.showToast(ForgetPwdActivity.this, "密码不能为空!"); |
| | | return; |
| | |
| | | return; |
| | | } |
| | | revisePwd(); |
| | | break; |
| | | } |
| | | break; |
| | | case R.id.tv_back: |
| | | finish(); |
| | | break; |
| | |
| | | if (!login) { |
| | | openOneKeyLogin(false); |
| | | } |
| | | |
| | | findViewById(R.id.tv_user_agreement_text).setOnClickListener(new OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | cb_user_agreement.setChecked(!cb_user_agreement.isChecked()); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | SingleToast.showToast(this, "请输入正确的手机号"); |
| | | break; |
| | | } |
| | | if (!cb_user_agreement.isChecked()) { |
| | | SingleToast.showToast(this, "请同意用户使用协议与隐私政策"); |
| | | break; |
| | | } |
| | | |
| | | tv_obtain_verfication_code.setEnabled(false); |
| | | if (login) { |
| | | sendLoginVerifyCode(phone); |
| | |
| | | findViewById(R.id.tv_back).setOnClickListener(this); |
| | | findViewById(R.id.tv_user_agreement).setOnClickListener(this); |
| | | findViewById(R.id.tv_privacy_policy).setOnClickListener(this); |
| | | findViewById(R.id.tv_user_agreement_click).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | cb_user_agreement.setChecked(!cb_user_agreement.isChecked()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | break; |
| | | } |
| | | |
| | | if (!cb_user_agreement.isChecked()) { |
| | | SingleToast.showToast(RegisterActivity.this, "请同意《用户使用协议》与《隐私政策》"); |
| | | break; |
| | | } |
| | | |
| | | Matcher m = IsEmail.isEmailAddress().matcher(email); |
| | | if (m.matches()) { |
| | | tv_obtain_verfication_code.setEnabled(false); |
| | |
| | | //隐藏咨询与小说 |
| | | mAQuery.id(R.id.rb_nav_discover).visibility(View.GONE); |
| | | mAQuery.id(R.id.rb_nav_novel).visibility(View.GONE); |
| | | if(AndroidManifestUtil.isOppoChannel(getApplicationContext())){ |
| | | mAQuery.id(R.id.rb_nav_short_tv).visibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | private void setSearchBarVisibility() { |
| | |
| | | if ("vivo".equalsIgnoreCase(AndroidManifestUtil.getChannel(getContext()))) { |
| | | return; |
| | | } |
| | | if( AndroidManifestUtil.isHuaWeiChannel(getContext())){ |
| | | if (AndroidManifestUtil.isHuaWeiChannel(getContext())) { |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | AdUtil.AD_TYPE adType = AdUtil.AD_TYPE.gdt2; |
| | | if(AndroidManifestUtil.isOppoChannel(getContext())){ |
| | | if (AndroidManifestUtil.isOppoChannel(getContext())) { |
| | | adType = null; |
| | | } |
| | | new ExpressAdManager(adType , getContext()).loadVideoDetailPlayerBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | new ExpressAdManager(adType, ExpressAdManager.POSITION_VIDEO_DETAIL_PLAYER_BOTTOM, getContext()).loadVideoDetailPlayerBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | |
| | | if (getActivity() == null) |
| | | return; |
| | | |
| | | ExpressAdManager.renderAd(getActivity(), adList.get(0), new ExpressAdManager.IAdRenderListener() { |
| | | ExpressAdManager.renderAd(getActivity(), adList.get(0), ExpressAdManager.POSITION_VIDEO_DETAIL_PLAYER_BOTTOM, new ExpressAdManager.IAdRenderListener() { |
| | | @Override |
| | | public void onRenderSuccess(List<ExpressAdContainer> adList) { |
| | | ExpressAdManager.fillAd(adList.get(0), fl_native_ad1); |
| | |
| | | |
| | | } else { |
| | | //加载穿山甲 |
| | | new ExpressAdManager(AndroidManifestUtil.isHuaWeiChannel(getContext())? AdUtil.AD_TYPE.hw :AdUtil.AD_TYPE.csj, getContext()).loadVideoDetailPlayerBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | ExpressAdManager expressAdManager = new ExpressAdManager(AndroidManifestUtil.isHuaWeiChannel(getContext()) ? AdUtil.AD_TYPE.hw : AdUtil.AD_TYPE.csj, ExpressAdManager.POSITION_VIDEO_DETAIL_PLAYER_BOTTOM, getContext()); |
| | | expressAdManager.loadVideoDetailPlayerBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | | ExpressAdManager.renderAndFillAd(getActivity(), adList.get(0), fl_native_ad1, new ExpressAdManager.IAdEventListener() { |
| | | expressAdManager.renderAndFillAd(getActivity(), adList.get(0), fl_native_ad1, ExpressAdManager.POSITION_VIDEO_DETAIL_PLAYER_BOTTOM, new ExpressAdManager.IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | fl_native_ad1.removeAllViews(); |
| | |
| | | } |
| | | |
| | | } else if (playUrl.getResource().getName().contains("风行")) { |
| | | boolean canPlayNative = true; |
| | | if(!AndroidManifestUtil.isHonorChannel(getApplicationContext())){ |
| | | canPlayNative = false; |
| | | } |
| | | |
| | | if(playUrl.getPlayType() == 2){ |
| | | // 不是vivo上线 |
| | | if(!AndroidManifestUtil.isVIVOChannel(getApplicationContext())){ |
| | | // 不是上线 |
| | | if(!canPlayNative){ |
| | | playUrl.setPlayType(1); |
| | | } |
| | | } |
| | |
| | | startActivity(intent); |
| | | saveWatchHistory("风行"); |
| | | initPlayer(); |
| | | } else if (playUrl.getPlayType() == 2 && AndroidManifestUtil.isVIVOChannel(getApplicationContext())) {//SDK播放 |
| | | } else if (playUrl.getPlayType() == 2 &&canPlayNative) {//SDK播放 |
| | | //播放风行视频 |
| | | //添加风行播放页 |
| | | // mFunshionPlayerFragment = new FunshionPlayerFragment(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 广点通原生广告 |
| | | */ |
| | | // 加载播放页第二条广告 |
| | | private void loadAD2() { |
| | | new ExpressAdManager(AdUtil.AD_TYPE.gdt2, getContext()).loadVideoDetailRelativeVideoBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | | ExpressAdManager.renderAd(getActivity(), adList.get(0), new ExpressAdManager.IAdRenderListener() { |
| | | @Override |
| | | public void onRenderSuccess(List<ExpressAdContainer> adList) { |
| | | ExpressAdManager.fillAd(adList.get(0), fl_native_ad_1); |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail(List<ExpressAdContainer> adList) { |
| | | |
| | | } |
| | | }, new ExpressAdManager.IAdEventListener() { |
| | | |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | fl_native_ad_1.removeAllViews(); |
| | | } |
| | | }); |
| | | } else { |
| | | new ExpressAdManager(AdUtil.AD_TYPE.csj, getContext()).loadVideoDetailRelativeVideoBottomAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | | ExpressAdManager.renderAndFillAd(getActivity(), adList.get(0), fl_native_ad_1, new ExpressAdManager.IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | fl_native_ad_1.removeAllViews(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy() { |
| | | if (rv_video_related_video != null && adRunnable != null) |
| | |
| | | try { |
| | | |
| | | // ExpressAdManager recommendAdManager = new ExpressAdManager(AdUtil.AD_TYPE.hw, context); |
| | | ExpressAdManager recommendAdManager = new ExpressAdManager(adType, context); |
| | | ExpressAdManager recommendAdManager = new ExpressAdManager(adType,ExpressAdManager.POSITION_RECOMMEND, context); |
| | | recommendAdManager.loadRecommendLargeAd(new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(final List<ExpressAdContainer> adList) { |
| | | RecommendFragment.this.adList = new ArrayList<>(); |
| | | for (ExpressAdContainer ad : adList) { |
| | | ExpressAdManager.renderAd(getActivity(), ad, new ExpressAdManager.IAdRenderListener() { |
| | | ExpressAdManager.renderAd(getActivity(), ad, ExpressAdManager.POSITION_RECOMMEND, new ExpressAdManager.IAdRenderListener() { |
| | | @Override |
| | | public void onRenderSuccess(List<ExpressAdContainer> adList1) { |
| | | RecommendFragment.this.adList.add(adList1.get(0)); |
| | |
| | | @Override |
| | | public void run() { |
| | | int width = fl_advertisement.getWidth() - fl_advertisement.getPaddingLeft() - fl_advertisement.getPaddingRight(); |
| | | new ExpressAdManager(adType, getApplicationContext()).loadSearchAd(DimenUtils.px2dip(getApplicationContext(), width), new ExpressAdManager.IAdLoadListener() { |
| | | ExpressAdManager adManager = new ExpressAdManager(adType,ExpressAdManager.POSITION_SEARCH, getApplicationContext()); |
| | | adManager.loadSearchAd(DimenUtils.px2dip(getApplicationContext(), width), new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | | ExpressAdManager.renderAndFillAd(SearchActivity.this, adList.get(0), fl_advertisement, new ExpressAdManager.IAdEventListener() { |
| | | adManager.renderAndFillAd(SearchActivity.this, adList.get(0), fl_advertisement, ExpressAdManager.POSITION_SEARCH, new ExpressAdManager.IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | fl_advertisement.removeAllViews(); |
| | |
| | | // if (AndroidManifestUtil.isHuaWeiChannel(getApplicationContext())) |
| | | // newAdType = AdUtil.AD_TYPE.hw; |
| | | |
| | | new ExpressAdManager(newAdType, getApplicationContext()).loadSearchAd(DimenUtils.px2dip(getApplicationContext(), width), new ExpressAdManager.IAdLoadListener() { |
| | | new ExpressAdManager(newAdType,ExpressAdManager.POSITION_SEARCH, getApplicationContext()).loadSearchAd(DimenUtils.px2dip(getApplicationContext(), width), new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | | ExpressAdManager.renderAndFillAd(SearchActivity.this, adList.get(0), fl_advertisement, new ExpressAdManager.IAdEventListener() { |
| | | ExpressAdManager.renderAndFillAd(SearchActivity.this, adList.get(0), fl_advertisement,ExpressAdManager.POSITION_SEARCH, new ExpressAdManager.IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | fl_advertisement.removeAllViews(); |
| | |
| | | final ExpressAdContainer ad = videoContent.getAd(); |
| | | viewHolder.fl_ad.removeAllViews(); |
| | | //渲染 |
| | | ExpressAdManager.renderAndFillAd(mContext, ad, viewHolder.fl_ad, new ExpressAdManager.IAdEventListener() { |
| | | ExpressAdManager.renderAndFillAd(mContext, ad, viewHolder.fl_ad, ExpressAdManager.POSITION_RECOMMEND, new ExpressAdManager.IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | contentList.remove(videoContent); |
| | |
| | | import com.weikou.beibeivideo.util.ui.TopStatusSettings; |
| | | import com.yeshi.video.player.util.PlayerFullScreenUtil; |
| | | |
| | | import java.net.URI; |
| | | import java.util.Set; |
| | | |
| | | public class VideoPlayerBrowserActivity extends BaseActivity implements OnClickListener { |
| | |
| | | prefixSet.add("iqiyi://"); |
| | | prefixSet.add("youku://"); |
| | | prefixSet.add("imgotv://"); |
| | | prefixSet.add("txvideo://"); |
| | | |
| | | for (String prefix : prefixSet) { |
| | | if (url.startsWith(prefix)) { |
| | |
| | | } |
| | | return true; |
| | | } |
| | | else if (url.contains("/a.app.qq.com/")&&url.contains("com.qiyi.video")) { |
| | | Uri uri = Uri.parse(url); |
| | | if(uri!=null) { |
| | | String packageName = uri.getQueryParameter("pkgname"); |
| | | if(packageName==null){ |
| | | return false; |
| | | } |
| | | runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(VideoPlayerBrowserActivity.this, "正在打开应用市场...", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | |
| | | try { |
| | | // 优先尝试Google Play |
| | | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName))); |
| | | } catch (ActivityNotFoundException e) { |
| | | // 如果Google Play不存在,尝试其他市场 |
| | | try { |
| | | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("amzn://apps/android?p=" + packageName))); |
| | | } catch (ActivityNotFoundException e2) { |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | | return super.shouldOverrideUrlLoading(view, request); |
| | |
| | | AdUtil.AD_TYPE adType = AdUtil.getAdType(context, AdPositionEnum.exitApp); |
| | | if (adType == AdUtil.AD_TYPE.gdt) |
| | | adType = AdUtil.AD_TYPE.gdt2; |
| | | expressAdManager = new ExpressAdManager(adType, context); |
| | | expressAdManager = new ExpressAdManager(adType, ExpressAdManager.POSITION_EXIT, context); |
| | | } |
| | | |
| | | |
| | |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | | |
| | | ExpressAdManager.renderAd(context, adList.get(0), new ExpressAdManager.IAdRenderListener() { |
| | | ExpressAdManager.renderAd(context, adList.get(0),ExpressAdManager.POSITION_EXIT, new ExpressAdManager.IAdRenderListener() { |
| | | @Override |
| | | public void onRenderSuccess(List<ExpressAdContainer> adList) { |
| | | expressAdContainer = adList.get(0); |
| | | if (show) { |
| | | ExpressAdManager.renderAndFillAd(context, adList.get(0), fl_advertisement, new IAdEventListener() { |
| | | ExpressAdManager.renderAndFillAd(context, adList.get(0), fl_advertisement, ExpressAdManager.POSITION_EXIT, new IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | fl_advertisement.removeAllViews(); |
| | |
| | | import com.weikou.beibeivideo.util.DimenUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 信息流广告管理 |
| | | */ |
| | | public class ExpressAdManager { |
| | | public final static String POSITION_RECOMMEND = "recommend"; |
| | | public final static String POSITION_SEARCH = "search"; |
| | | public final static String POSITION_SEARCH_RESULT = "search_result"; |
| | | public final static String POSITION_VIDEO_DETAIL_PLAYER_BOTTOM = "video_detail_player_bottom"; |
| | | public final static String POSITION_EXIT = "exit"; |
| | | |
| | | |
| | | final static String TAG = "ExpressAdManager"; |
| | |
| | | |
| | | private TTAdNative mTTAdNative; |
| | | private Context mContext; |
| | | private static Set<String> closedAdPositions = new HashSet<>();// 是否已经关闭广告 |
| | | private String positionName; |
| | | |
| | | |
| | | public ExpressAdManager(AdUtil.AD_TYPE adSource, Context context) { |
| | | public ExpressAdManager(AdUtil.AD_TYPE adSource, String positionName, Context context) { |
| | | sourceType = adSource; |
| | | this.mContext = context; |
| | | if (sourceType == AdUtil.AD_TYPE.csj) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | this.positionName = positionName; |
| | | } |
| | | |
| | | |
| | |
| | | * @param adLoadListener |
| | | */ |
| | | public void loadAd(int widthDP, int heightDP, String pid, int count, final IAdLoadListener adLoadListener) { |
| | | if (closedAdPositions.contains(positionName)) { |
| | | // 广告已经关闭 |
| | | return; |
| | | } |
| | | if (sourceType == AdUtil.AD_TYPE.gdt || sourceType == AdUtil.AD_TYPE.gdt2) { |
| | | loadGDT(pid, widthDP, heightDP, count, new IGDTAdLoadListener() { |
| | | @Override |
| | |
| | | * @param adLoadListener |
| | | */ |
| | | public void loadVideoDetailPlayerBottomAd(final IAdLoadListener adLoadListener) { |
| | | if(sourceType==null){ |
| | | if (sourceType == null) { |
| | | return; |
| | | } |
| | | Log.i(TAG, "loadVideoDetailPlayerBottomAd"); |
| | |
| | | int height = (int) (widthDP / 1.78f); |
| | | if (sourceType == AdUtil.AD_TYPE.csj) { |
| | | pid = CSJConstant.VIDEO_SEARCH; |
| | | height=0; |
| | | height = 0; |
| | | } else if (sourceType == AdUtil.AD_TYPE.gdt2) { |
| | | pid = BeibeiConstant.GDT_SEARCH_NATIVE; |
| | | } else if (sourceType == AdUtil.AD_TYPE.hw) { |
| | |
| | | * @param fl_ad |
| | | * @param adEventListener |
| | | */ |
| | | public static void renderAndFillAd(Activity activity, final ExpressAdContainer ad, final FrameLayout fl_ad, final IAdEventListener adEventListener) { |
| | | public static void renderAndFillAd(Activity activity, final ExpressAdContainer ad, final FrameLayout fl_ad, String positionName, final IAdEventListener adEventListener) { |
| | | |
| | | if (ad == null) {//广告为空 |
| | | fl_ad.setVisibility(View.GONE); |
| | |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | closedAdPositions.add(positionName); |
| | | } |
| | | |
| | | |
| | |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | closedAdPositions.add(positionName); |
| | | } |
| | | }); |
| | | |
| | |
| | | * @param adRenderListener |
| | | * @param adEventListener |
| | | */ |
| | | public static void renderAd(Activity activity, final ExpressAdContainer ad, final IAdRenderListener adRenderListener, final IAdEventListener adEventListener) { |
| | | public static void renderAd(Activity activity, final ExpressAdContainer ad, String positionName, final IAdRenderListener adRenderListener, final IAdEventListener adEventListener) { |
| | | |
| | | if (ad == null) {//广告为空 |
| | | return; |
| | |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | closedAdPositions.add(positionName); |
| | | } |
| | | |
| | | |
| | |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | closedAdPositions.add(positionName); |
| | | } |
| | | }); |
| | | |
| | |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.bytedance.sdk.openadsdk.TTCustomController; |
| | | import com.lcjian.library.util.common.AndroidManifestUtil; |
| | | import com.lcjian.library.util.common.DeviceUtil; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.ad.AdPositionEnum; |
| | |
| | | public String getDevImei() { |
| | | return DeviceUtil.getImeiCache(context); |
| | | } |
| | | |
| | | @Override |
| | | public boolean alist() { |
| | | if(AndroidManifestUtil.isHonorChannel(context)){ |
| | | return false; |
| | | } |
| | | return super.alist(); |
| | | } |
| | | }); |
| | | //.httpStack(new MyOkStack3())//自定义网络库,demo中给出了okhttp3版本的样例,其余请自行开发或者咨询工作人员。 |
| | | //if (AdUtil.getAdType(context, AdPositionEnum.splashHotStart) != null) { |
| | |
| | | mContext = context; |
| | | if (expressAdManager == null) |
| | | // expressAdManager = new ExpressAdManager(AdUtil.AD_TYPE.gdt2, mContext); |
| | | expressAdManager = new ExpressAdManager(AndroidManifestUtil.isHuaWeiChannel(context)? AdUtil.AD_TYPE.hw:AdUtil.AD_TYPE.gdt2, mContext); |
| | | expressAdManager = new ExpressAdManager(AndroidManifestUtil.isHuaWeiChannel(context)? AdUtil.AD_TYPE.hw:AdUtil.AD_TYPE.gdt2,ExpressAdManager.POSITION_SEARCH_RESULT, mContext); |
| | | } |
| | | |
| | | public static SearchResultAdManager getInstance(Context context) { |
| | |
| | | |
| | | if (adList != null) |
| | | for (ExpressAdContainer ad : adList) |
| | | ExpressAdManager.renderAd(null, ad, new ExpressAdManager.IAdRenderListener() { |
| | | ExpressAdManager.renderAd(null, ad, ExpressAdManager.POSITION_SEARCH_RESULT, new ExpressAdManager.IAdRenderListener() { |
| | | @Override |
| | | public void onRenderSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null) |
| | |
| | | maven { |
| | | url "https://artifact.bytedance.com/repository/pangle/" |
| | | } |
| | | |
| | | maven { |
| | | url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_support/" |
| | | } |
| | | |
| | | maven { url "https://artifact.bytedance.com/repository/AwemeOpenSDK" } |
| | | |
| | | |
| | |
| | | |
| | | maven { url "https://artifact.bytedance.com/repository/AwemeOpenSDK" } |
| | | |
| | | maven { |
| | | url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_support/" |
| | | } |
| | | |
| | | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/public" |
| | |
| | | return "huawei".equalsIgnoreCase(getChannel(context)); |
| | | } |
| | | |
| | | public static boolean isHonorChannel(Context context) { |
| | | return "honor".equalsIgnoreCase(getChannel(context)); |
| | | } |
| | | |
| | | public static boolean isOppoChannel(Context context) { |
| | | return "oppo".equalsIgnoreCase(getChannel(context)); |
| | | } |