| | |
| | | |
| | | private void getVideoDetail(final Context context, String videoId, |
| | | String videoThirdType, final boolean isSetup) { |
| | | int position = getIntent().getIntExtra( |
| | | "playing_position", 0); |
| | | SharedPreferences preferences = context.getSharedPreferences("user", |
| | | Context.MODE_PRIVATE); |
| | | String uid = preferences.getString("uid", ""); |
| | | String loginid = preferences.getString("LoginUid", ""); |
| | | BeibeiVideoAPI.getVideoDetail(context, uid, resourceId, videoId, loginid, |
| | | BeibeiVideoAPI.getVideoDetail(context, uid, resourceId, videoId, position, loginid, |
| | | videoThirdType, new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onStart() { |
| | | super.onStart(); |
| | | // if (BeibeiConstant.DEBUG) |
| | | // Toast.makeText(VideoDetailActivity2.this, "onStart", |
| | | // Toast.LENGTH_SHORT).show(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | String responseString, Throwable throwable) { |
| | | super.onFailure(statusCode, headers, responseString, |
| | | throwable); |
| | | // if (BeibeiConstant.DEBUG) |
| | | // Toast.makeText(VideoDetailActivity2.this, "onFailure", |
| | | // Toast.LENGTH_SHORT).show(); |
| | | if (progressDialog.isShowing()) { |
| | | progressDialog.dismiss(); |
| | | } |
| | |
| | | Header[] headers, JSONObject jsonObject) |
| | | throws Exception { |
| | | |
| | | boolean pptv = true; |
| | | if (pptv) { |
| | | fl_pptv.setVisibility(View.VISIBLE); |
| | | ll_other.setVerticalGravity(View.GONE); |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fl_pptv, new PPTVPlayFragment()).commit(); |
| | | if (progressDialog.isShowing()) { |
| | | progressDialog.dismiss(); |
| | | } |
| | | return; |
| | | } else { |
| | | fl_pptv.setVisibility(View.GONE); |
| | | ll_other.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | // if (BeibeiConstant.DEBUG) |
| | | // Toast.makeText(VideoDetailActivity2.this, |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | if (jsonObject.getBoolean("IsPost")) { |
| | | JSONObject data = jsonObject.optJSONObject("Data"); |
| | | boolean pptv = data.optBoolean("pptv", false); |
| | | if (pptv) { |
| | | String playUrl = data.optString("playUrl"); |
| | | fl_pptv.setVisibility(View.VISIBLE); |
| | | ll_other.setVerticalGravity(View.GONE); |
| | | PPTVPlayFragment pptvPlayFragment = new PPTVPlayFragment(); |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putString("playUrl", playUrl); |
| | | bundle.putString("videoId",data.optString("videoId")); |
| | | pptvPlayFragment.setArguments(bundle); |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fl_pptv, pptvPlayFragment).commit(); |
| | | if (progressDialog.isShowing()) { |
| | | progressDialog.dismiss(); |
| | | } |
| | | return; |
| | | } else { |
| | | fl_pptv.setVisibility(View.GONE); |
| | | ll_other.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | |
| | | findViewById(R.id.fragment_video_detail_container) |
| | | .setVisibility(View.VISIBLE); |
| | | findViewById(R.id.fragment_video_episode_container) |