| | |
| | | |
| | | <activity |
| | | android:name="com.weikou.beibeivideo.ui.SplashActivity" |
| | | android:exported="true" |
| | | android:label="@string/app_name"> |
| | | <intent-filter> |
| | | <action android:name="android.intent.action.MAIN" /> |
| | |
| | | </activity> |
| | | <activity |
| | | android:name="com.weikou.beibeivideo.ui.main.MainActivity" |
| | | android:exported="true" |
| | | android:label="@string/app_name" |
| | | android:launchMode="singleTask" |
| | | android:theme="@style/AppTabTheme3"></activity> |
| | |
| | | |
| | | <provider |
| | | android:name="com.weikou.beibeivideo.db.WatchHistoryProvider" |
| | | android:authorities="com.yeshi.ddysvideo.provider.watchhistory" |
| | | android:exported="false" /> |
| | | android:authorities="com.yeshi.ddysvideo.provider.watchhistory" /> |
| | | <provider |
| | | android:name="com.weikou.beibeivideo.db.DownloadProvider" |
| | | android:authorities="com.yeshi.ddysvideo.provider.download" |
| | | android:exported="false" /> |
| | | android:authorities="com.yeshi.ddysvideo.provider.download" /> |
| | | <provider |
| | | android:name="com.weikou.beibeivideo.db.MessageProvider" |
| | | android:authorities="com.yeshi.ddysvideo.provider.message" |
| | | android:exported="false" /> |
| | | android:authorities="com.yeshi.ddysvideo.provider.message" /> |
| | | <provider |
| | | android:name="com.mozillaonline.providers.downloads.DownloadProvider" |
| | | android:authorities="com.ddysvideo.downloads" |
| | | android:exported="false" /> |
| | | android:authorities="com.ddysvideo.downloads" /> |
| | | |
| | | <!--百度内容联盟 --> |
| | | <provider |
| | |
| | | <!-- 网盟广告 --> |
| | | <provider |
| | | android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider" |
| | | android:authorities="com.doudou.ysvideo.TTMultiProvider" |
| | | android:exported="false" /> |
| | | android:authorities="com.doudou.ysvideo.TTMultiProvider" /> |
| | | |
| | | <!--新浪 --> |
| | | <activity |
| | |
| | | android:name="push_kit_auto_init_enabled" |
| | | android:value="true" /> |
| | | <!-- 华为推送服务注册 --> |
| | | <service |
| | | android:name=".service.HWPushService" |
| | | android:exported="false"> |
| | | <service android:name=".service.HWPushService"> |
| | | <intent-filter> |
| | | <action android:name="com.huawei.push.action.MESSAGING_EVENT" /> |
| | | </intent-filter> |
| | |
| | | |
| | | |
| | | <!-- VIVO推送 --> |
| | | <receiver |
| | | android:name=".receiver.VIVOPushMessageReceiver" |
| | | android:exported="false"> |
| | | <receiver android:name=".receiver.VIVOPushMessageReceiver"> |
| | | <intent-filter> |
| | | <!--接收push消息--> |
| | | <action android:name="com.vivo.pushclient.action.RECEIVE" /> |
| | |
| | | |
| | | defaultConfig { |
| | | applicationId "com.doudou.ysvideo" |
| | | versionCode 109 |
| | | versionName "3.9.0" |
| | | versionCode 110 |
| | | versionName "3.9.1" |
| | | multiDexEnabled = true |
| | | minSdkVersion 17 |
| | | targetSdkVersion 27 |
| | |
| | | * @param handler |
| | | */ |
| | | public static void getVideoEpisodeList(Context context, String uid, |
| | | String ResourceId, String videoId, int page, |
| | | String ResourceId, String videoId, int page,int pageSize, |
| | | ResponseHandlerInterface handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); |
| | | params.put("Method", "getVideoEpisodeList"); |
| | | params.put("Uid", uid); |
| | | params.put("Page", page + ""); |
| | | params.put("PageSize", pageSize + ""); |
| | | params.put("VideoId", videoId); |
| | | params.put("ResourceId", ResourceId); |
| | | commonPost(context, BASE_URL + "recommend", params, handler); |
| | |
| | | @Override |
| | | public void onAdLoad(SplashAdLoadInfo adLoadInfo) { |
| | | //展示广告 |
| | | try { |
| | | startActivity(new Intent(getApplicationContext(), SplashAdActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); |
| | | } catch (SecurityException e) { |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Expose |
| | | private VideoAlbumMoreInfo albumMoreInfo; |
| | | |
| | | //页大小 |
| | | @Expose |
| | | private int pageSize; |
| | | |
| | | |
| | | public int getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(int pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public VideoAlbumMoreInfo getAlbumMoreInfo() { |
| | | return albumMoreInfo; |
| | | } |
| | |
| | | //初始化一次Banner,否则后面Banner使用时会出现卡顿 |
| | | // new BannerView(SplashActivity.this, ADSize.BANNER, BeibeiConstant.GDT_ID, BeibeiConstant.GDT_PLAYER_DETAIL); |
| | | //弹用户协议框 |
| | | |
| | | showProtocol(); |
| | | |
| | | |
| | |
| | | "4、未经监护人同意,我们不会收集使用14周岁以下(含14周岁)未成年人个人信息,且不会利用其信息推送新闻、时政信息、广告等定向推送活动。"; |
| | | |
| | | if (!UserUtil.isAgreeUserProtocol(BeibeiVideoApplication.application) && !BeibeiConstant.IS_TEST) { |
| | | new UserProtocolDialog.Builder(this).setNegativeButton("不同意", new DialogInterface.OnClickListener() { |
| | | Dialog dialog = new UserProtocolDialog.Builder(this).setNegativeButton("不同意", new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | SplashActivity.this.finish(); |
| | |
| | | } |
| | | }); |
| | | } |
| | | }).setData(data).create().show(); |
| | | }).setData(data).create(); |
| | | |
| | | if (!isFinishing()) { |
| | | dialog.show(); |
| | | } |
| | | |
| | | } else { |
| | | //请求权限 |
| | | vg_ad.post(new Runnable() { |
| | |
| | | this.mAdShowListener = mAdShowListener; |
| | | } |
| | | |
| | | private SplashADFragment() { |
| | | public SplashADFragment() { |
| | | |
| | | } |
| | | |
| | |
| | | package com.weikou.beibeivideo.ui.ad; |
| | | |
| | | import android.os.Bundle; |
| | | import android.view.KeyEvent; |
| | | |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.entity.ad.SplashAdLoadInfo; |
| | |
| | | finish(); |
| | | } |
| | | }); |
| | | |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fl_splash_ad, splashADFragment).commitAllowingStateLoss(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean onKeyDown(int keyCode, KeyEvent event) { |
| | | if (keyCode == KeyEvent.KEYCODE_BACK) |
| | | return false; |
| | | else |
| | | return super.onKeyDown(keyCode, event); |
| | | } |
| | | |
| | | public void onEventMainThread(SplashAdLoadInfo adLoadInfo) { |
| | | finish(); |
| | | } |
| | |
| | | VideoInfo videoInfo = new VideoInfo(); |
| | | videoInfo.setId("8065880"); |
| | | videoInfo.setThirdType("0"); |
| | | Intent intent = new Intent(MainActivity.this, VideoDetailActivity2.class); |
| | | Intent intent = new Intent(MainActivity.this, SearchActivity.class); |
| | | intent.putExtra("video_info", videoInfo); |
| | | startActivity(intent); |
| | | } |
| | |
| | | |
| | | private int episodePage = 2;//当前页 |
| | | |
| | | //默认页大小为100 |
| | | private int pageSize = 100; |
| | | |
| | | private String fromName = null; |
| | | |
| | | public static DisplayImageOptions option = new DisplayImageOptions.Builder() |
| | |
| | | .build(); |
| | | |
| | | public static EpisodeFragment newInstance(VideoInfo videoInfo, |
| | | int playingPosition, int start, int end, String from) { |
| | | int playingPosition, int pageSize, int start, int end, String from) { |
| | | EpisodeFragment episodeFragment = new EpisodeFragment(); |
| | | Bundle args = new Bundle(); |
| | | args.putSerializable("video_info", videoInfo); |
| | | args.putInt("playing_position", playingPosition); |
| | | args.putInt("start", start); |
| | | args.putInt("end", end); |
| | | args.putInt("pageSize", pageSize); |
| | | args.putString("from", from); |
| | | episodeFragment.setArguments(args); |
| | | return episodeFragment; |
| | |
| | | .getString("from", ""); |
| | | |
| | | mPlayingPosition = bundle.getInt("playing_position"); |
| | | pageSize = bundle.getInt("pageSize", 100); |
| | | mStart = bundle.getInt("start"); |
| | | mEnd = bundle.getInt("end"); |
| | | |
| | |
| | | break; |
| | | } |
| | | if (checkedResource != null) { |
| | | loadMoreEpisode(mVideoInfo.getId(), checkedResource.getId(), episodePage); |
| | | loadMoreEpisode(mVideoInfo.getId(), checkedResource.getId(), episodePage, pageSize); |
| | | } |
| | | } |
| | | } |
| | |
| | | ImageView iv = view.findViewById(R.id.iv_resource); |
| | | TextView tv = view.findViewById(R.id.tv_resource); |
| | | try { |
| | | Glide.with(getActivity().getApplicationContext()) |
| | | Glide.with(iv) |
| | | .load(reList.get(position).getPicture()) |
| | | .apply(new RequestOptions().placeholder(R.drawable.from_other).error(R.drawable.from_other)) |
| | | .into(iv); |
| | |
| | | * @param videoId |
| | | * @param resourceId |
| | | */ |
| | | private synchronized void loadMoreEpisode(String videoId, String resourceId, int page) { |
| | | BeibeiVideoAPI.getVideoEpisodeList(ll_add_attention.getContext(), UserUtil.getUid(getContext()), resourceId, videoId, page, new |
| | | private synchronized void loadMoreEpisode(String videoId, String resourceId, int page, int pageSize) { |
| | | BeibeiVideoAPI.getVideoEpisodeList(ll_add_attention.getContext(), UserUtil.getUid(getContext()), resourceId, videoId, page, pageSize, new |
| | | |
| | | BasicTextHttpResponseHandler() { |
| | | @Override |
| | |
| | | private int mPlayingPosition; |
| | | |
| | | private String fromName; |
| | | private int pageSize; |
| | | |
| | | public EpisodePagerAdapter(FragmentManager fm, VideoInfo videoInfo, |
| | | int playingPosition, String from) { |
| | | int playingPosition, int pageSize, String from) { |
| | | super(fm); |
| | | this.mVideoInfo = videoInfo; |
| | | this.mPlayingPosition = playingPosition; |
| | | this.fromName = from; |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (end > VideoUtil.videoEpisodeList.size()) { |
| | | end = VideoUtil.videoEpisodeList.size(); |
| | | } |
| | | return EpisodeFragment.newInstance(mVideoInfo, getPlayingPosition(), start, |
| | | return EpisodeFragment.newInstance(mVideoInfo, getPlayingPosition(), pageSize, start, |
| | | end, fromName); |
| | | } |
| | | |
| | |
| | | Log.i("mResult", "是否是从观看记录点击进来的:" + isFromWatchHistory); |
| | | if (isFromWatchHistory || position > 0) { |
| | | mPosition = getIntent().getIntExtra("playing_position", 0); |
| | | //防止数组越界 |
| | | mPosition = mPosition >= VideoUtil.videoEpisodeList.size() ? VideoUtil.videoEpisodeList.size() - 1 : mPosition; |
| | | EventBus.getDefault().post(videoInfo); |
| | | getUrl(VideoUtil.videoEpisodeList.get(mPosition), isSetup); |
| | | EventBus.getDefault().post(VideoUtil.videoEpisodeList.get(mPosition)); |
| | |
| | | |
| | | @Override |
| | | public void run() { |
| | | |
| | | try { |
| | | EventBus.getDefault().post( |
| | | videoInfo); |
| | | EventBus.getDefault() |
| | | .post(VideoUtil.videoEpisodeList |
| | | .get(0)); |
| | | } catch (NullPointerException e) { |
| | | //出现过空指针的异常 |
| | | } |
| | | } |
| | | }, 200); |
| | | } |
| | |
| | | @Override |
| | | public void run() { |
| | | EventBus.getDefault().post(videoInfo); |
| | | int position = getIntent().getIntExtra("playing_position", 0) >= |
| | | VideoUtil.videoEpisodeList.size() ? VideoUtil.videoEpisodeList.size() - 1 : getIntent().getIntExtra("playing_position", |
| | | 0); |
| | | EventBus.getDefault().post( |
| | | VideoUtil.videoEpisodeList.get( |
| | | getIntent().getIntExtra("playing_position", |
| | | 0))); |
| | | VideoUtil.videoEpisodeList.get(position)); |
| | | } |
| | | }, 200); |
| | | } |
| | |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable("video_info", mVideoInfo); |
| | | bundle.putInt("playing_position", mPlayingPosition); |
| | | bundle.putInt("pageSize", mVideoInfo.getPageSize()); |
| | | videoEpisodeFragment.setArguments(bundle); |
| | | getChildFragmentManager().beginTransaction().add(R.id.fl_add_container, videoEpisodeFragment, "VideoEpisodeFragment").commitAllowingStateLoss(); |
| | | |
| | |
| | | private String from; |
| | | |
| | | public static VideoEpisodeFragment newInstance(VideoInfo videoInfo, |
| | | int playingPostion, String from) { |
| | | int playingPostion, int pageSize, String from) { |
| | | VideoEpisodeFragment videoEpisodeFragment = new VideoEpisodeFragment(); |
| | | Bundle args = new Bundle(); |
| | | args.putSerializable("video_info", videoInfo); |
| | | args.putInt("playing_position", playingPostion); |
| | | args.putInt("pageSize", pageSize); |
| | | args.putString("from", from); |
| | | videoEpisodeFragment.setArguments(args); |
| | | return videoEpisodeFragment; |
| | |
| | | return R.layout.video_episode_fragment; |
| | | } |
| | | |
| | | private int pageSize = 100; |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.d(TAG, "onCreateView"); |
| | | sv_detail = contentView.findViewById(R.id.sv_detail); |
| | | mVideoInfo = (VideoInfo) getArguments().getSerializable("video_info"); |
| | | mPlayingPosition = getArguments().getInt("playing_position"); |
| | | pageSize = getArguments().getInt("pageSize", 100); |
| | | |
| | | if (getArguments() != null) |
| | | getArguments().clear(); |
| | | // ******简介******* |
| | |
| | | return; |
| | | |
| | | mEpisodePagerAdapter = new EpisodePagerAdapter( |
| | | getChildFragmentManager(), mVideoInfo, mPlayingPosition, from); |
| | | getChildFragmentManager(), mVideoInfo, mPlayingPosition, pageSize, from); |
| | | // |
| | | vp_episode.setAdapter(mEpisodePagerAdapter); |
| | | // 指示当前播放页---hxh |
| | |
| | | if (mPlayingPosition != playingPosition) { |
| | | mPlayingPosition = playingPosition; |
| | | } |
| | | pageSize = info.getPageSize(); |
| | | mEpisodePagerAdapter = new EpisodePagerAdapter( |
| | | getChildFragmentManager(), info, mPlayingPosition, from); |
| | | getChildFragmentManager(), info, mPlayingPosition, pageSize, from); |
| | | // |
| | | vp_episode.setAdapter(mEpisodePagerAdapter); |
| | | } |
| | |
| | | public void onClick(final View v) { |
| | | switch (v.getId()) { |
| | | case R.id.tv_search_cancel: |
| | | if (fl_suggest.getVisibility() == View.VISIBLE) { |
| | | hiddenSuggestFragment(); |
| | | } else |
| | | finish(); |
| | | break; |
| | | case R.id.tv_search_clear_his: |
| | |
| | | new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onStart() { |
| | | super.onStart(); |
| | | hiddenSuggestFragment(); |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, |
| | | Header[] headers, JSONObject jsonObject) |
| | | throws Exception { |
| | |
| | | |
| | | //广告展示完成 |
| | | private void adShowFinish(FunshionPlayInfo info) { |
| | | if (fl_ad == null) |
| | | return; |
| | | fl_ad.setVisibility(View.GONE); |
| | | fl_ad.removeAllViews(); |
| | | //播放视频 |
| | |
| | | vpc_funshion.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (tv_skip != null) |
| | | tv_skip.setVisibility(View.GONE); |
| | | adShowFinish(info); |
| | | } |
| | |
| | | import android.app.Notification; |
| | | import android.app.NotificationChannel; |
| | | import android.app.NotificationManager; |
| | | import android.content.ActivityNotFoundException; |
| | | import android.content.Intent; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.content.res.Configuration; |
| | |
| | | public void onClick(View v) { |
| | | hiddenMenu(); |
| | | String url = tv_url.getText().toString(); |
| | | try { |
| | | Uri uri = Uri.parse(url); |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, uri); |
| | | startActivity(intent); |
| | | } catch (ActivityNotFoundException e) { |
| | | Toast.makeText(VideoPlayerBrowserActivity.this, "无法找到浏览器", Toast.LENGTH_SHORT).show(); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | //step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明 |
| | | private static void doInit(Context context) { |
| | | if (!sInit) { |
| | | try { |
| | | TTAdSdk.init(context, buildConfig(context)); |
| | | sInit = true; |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | private View mContentView; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public View onCreateView(LayoutInflater inflater, ViewGroup container, |
| | | Bundle savedInstanceState) { |
| | |
| | | try { |
| | | ((ViewGroup) mContentView.getParent()).removeView(mContentView); |
| | | } catch (Exception e) { |
| | | if (container != null) |
| | | container.removeView(mContentView); |
| | | } |
| | | } |