| | |
| | | |
| | | private int episodePage = 2;//当前页 |
| | | |
| | | private String fromName = null; |
| | | |
| | | public static DisplayImageOptions option = new DisplayImageOptions.Builder() |
| | | .showImageForEmptyUri(R.drawable.from_other) |
| | | .showImageOnFail(R.drawable.from_other) |
| | |
| | | .build(); |
| | | |
| | | public static EpisodeFragment newInstance(VideoInfo videoInfo, |
| | | int playingPosition, int start, int end) { |
| | | int playingPosition, 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.putString("from", from); |
| | | episodeFragment.setArguments(args); |
| | | return episodeFragment; |
| | | } |
| | |
| | | Bundle bundle = getArguments(); |
| | | mVideoInfo = (VideoInfo) bundle |
| | | .getSerializable("video_info"); |
| | | fromName = bundle |
| | | .getString("from", ""); |
| | | |
| | | mPlayingPosition = bundle.getInt("playing_position"); |
| | | mStart = bundle.getInt("start"); |
| | | mEnd = bundle.getInt("end"); |
| | |
| | | pd.show(); |
| | | getVideoDetail(mVideoInfo.getId(), urlList |
| | | .get(position).getId(), mVideoInfo |
| | | .getThirdType(), true); |
| | | .getThirdType(), true,fromName); |
| | | } |
| | | selectedUrl = urlList.get(position); |
| | | if (selectedUrl == null || selectedUrl.getPicture() == null) { |
| | |
| | | } |
| | | |
| | | private void getVideoDetail(String videoId, final String resourceId, |
| | | String videoThirdType, final boolean isSetup) { |
| | | String videoThirdType, final boolean isSetup, final String from) { |
| | | SharedPreferences preferences = getContext().getSharedPreferences( |
| | | "user", Context.MODE_PRIVATE); |
| | | String uid = preferences.getString("uid", ""); |
| | | String loginid = preferences.getString("LoginUid", ""); |
| | | BeibeiVideoAPI.getVideoDetail(getContext(), uid, resourceId, videoId,null, loginid, |
| | | videoThirdType, new BasicTextHttpResponseHandler() { |
| | | BeibeiVideoAPI.getVideoDetail(getContext(), uid, resourceId, videoId, null, loginid, |
| | | videoThirdType, from, new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onStart() { |
| | |
| | | }.getType()); |
| | | if (videoInfo != null) { |
| | | |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,videoInfo.getVideoDetailList(),false); |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application, videoInfo.getVideoDetailList(), false); |
| | | |
| | | } |
| | | // 附加字段 |
| | |
| | | rv_episode.getAdapter().notifyDataSetChanged(); |
| | | // videoInfo.setSave(jsonObject.getJSONObject("Data").optBoolean("Save")); |
| | | if (isSetup) { |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,videoInfo.getVideoDetailList(),false); |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application, videoInfo.getVideoDetailList(), false); |
| | | |
| | | EventBus.getDefault().post(videoInfo); |
| | | int position = 0; |
| | |
| | | }.getType()); |
| | | if (list != null && list.size() > 0) { |
| | | episodePage++; |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application,list,true); |
| | | VideoUtil.saveVideoEpisodeList(BeibeiVideoApplication.application, list, true); |
| | | rv_episode.getAdapter().notifyDataSetChanged(); |
| | | } |
| | | } |