|
@@ -8,7 +8,6 @@ import android.net.Uri;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.Nullable;
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.design.widget.CheckableImageButton;
|
|
import android.support.design.widget.CheckableImageButton;
|
|
|
-import android.support.v4.app.Fragment;
|
|
|
|
|
import android.support.v7.widget.AppCompatCheckedTextView;
|
|
import android.support.v7.widget.AppCompatCheckedTextView;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
import android.view.GestureDetector;
|
|
import android.view.GestureDetector;
|
|
@@ -21,7 +20,7 @@ import android.widget.TextView;
|
|
|
import android.widget.VideoView;
|
|
import android.widget.VideoView;
|
|
|
|
|
|
|
|
import com.kfzs.duanduan.utils.StatusBarUtils;
|
|
import com.kfzs.duanduan.utils.StatusBarUtils;
|
|
|
-import com.sheep.gamegroup.absBase.BaseContainerActivity;
|
|
|
|
|
|
|
+import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.DiscoveryVideo;
|
|
import com.sheep.gamegroup.model.entity.DiscoveryVideo;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
@@ -33,7 +32,6 @@ import com.sheep.gamegroup.util.TestUtil;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.util.share.CommonUMShareListener;
|
|
import com.sheep.gamegroup.util.share.CommonUMShareListener;
|
|
|
import com.sheep.gamegroup.util.share.ShareLinkConfig;
|
|
import com.sheep.gamegroup.util.share.ShareLinkConfig;
|
|
|
-import com.sheep.gamegroup.view.fragment.FgtVideoComment;
|
|
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
@@ -48,7 +46,7 @@ import io.reactivex.schedulers.Schedulers;
|
|
|
* realicing@sina.com
|
|
* realicing@sina.com
|
|
|
* 小绵羊3.4.5新增 -- 视频详情
|
|
* 小绵羊3.4.5新增 -- 视频详情
|
|
|
*/
|
|
*/
|
|
|
-public class ActPlayVideoArticle extends BaseContainerActivity implements MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener, View.OnLayoutChangeListener {
|
|
|
|
|
|
|
+public class ActPlayVideoArticle extends BaseActivity implements MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener, View.OnLayoutChangeListener {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -84,13 +82,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
@BindView(R.id.video_title_tv)
|
|
@BindView(R.id.video_title_tv)
|
|
|
TextView video_title_tv;
|
|
TextView video_title_tv;
|
|
|
|
|
|
|
|
- @BindView(R.id.frame_container)
|
|
|
|
|
- View frame_container;
|
|
|
|
|
-
|
|
|
|
|
- //评论
|
|
|
|
|
- private FgtVideoComment fgtVideoComment;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected int getLayoutId() {
|
|
protected int getLayoutId() {
|
|
|
return R.layout.act_play_video_article;
|
|
return R.layout.act_play_video_article;
|
|
@@ -103,33 +94,21 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void initView() {
|
|
public void initView() {
|
|
|
- super.initView();
|
|
|
|
|
initVolume();
|
|
initVolume();
|
|
|
DiscoveryVideo lastVideo = DataUtil.getObject(getIntent(), DiscoveryVideo.class);
|
|
DiscoveryVideo lastVideo = DataUtil.getObject(getIntent(), DiscoveryVideo.class);
|
|
|
if (lastVideo == null) {
|
|
if (lastVideo == null) {
|
|
|
video_id = DataUtil.getObject(getIntent(), Integer.class);
|
|
video_id = DataUtil.getObject(getIntent(), Integer.class);
|
|
|
- fgtVideoComment.setVideo_id(video_id);
|
|
|
|
|
loadVideoData(null);
|
|
loadVideoData(null);
|
|
|
} else {
|
|
} else {
|
|
|
video_id = lastVideo.getId();
|
|
video_id = lastVideo.getId();
|
|
|
- fgtVideoComment.setVideo_id(video_id);
|
|
|
|
|
user_id = lastVideo.getUser_id();
|
|
user_id = lastVideo.getUser_id();
|
|
|
video_url = lastVideo.getResource();
|
|
video_url = lastVideo.getResource();
|
|
|
loadVideoData(lastVideo);
|
|
loadVideoData(lastVideo);
|
|
|
}
|
|
}
|
|
|
ViewUtil.setImage(video_camera_iv, ViewUtil.getNetImgByName("add_article_camera"));
|
|
ViewUtil.setImage(video_camera_iv, ViewUtil.getNetImgByName("add_article_camera"));
|
|
|
- ViewUtil.setVisibility2(frame_container, false);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- protected Fragment initFragment() {
|
|
|
|
|
- fgtVideoComment = new FgtVideoComment();
|
|
|
|
|
- return fgtVideoComment;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void loadVideoData(DiscoveryVideo video) {
|
|
private void loadVideoData(DiscoveryVideo video) {
|
|
|
- if (fgtVideoComment != null)
|
|
|
|
|
- fgtVideoComment.loadVideoData(video);
|
|
|
|
|
if (video == null) {
|
|
if (video == null) {
|
|
|
ViewUtil.setText(video_like_tv, ViewUtil.BLOCK);
|
|
ViewUtil.setText(video_like_tv, ViewUtil.BLOCK);
|
|
|
ViewUtil.setText(video_comment_tv, ViewUtil.BLOCK);
|
|
ViewUtil.setText(video_comment_tv, ViewUtil.BLOCK);
|
|
@@ -153,7 +132,7 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
videoView.setOnErrorListener(this);
|
|
videoView.setOnErrorListener(this);
|
|
|
videoView.setOnCompletionListener(this);
|
|
videoView.setOnCompletionListener(this);
|
|
|
videoView.addOnLayoutChangeListener(this);
|
|
videoView.addOnLayoutChangeListener(this);
|
|
|
- videoView.setMediaController(new MediaController(this));
|
|
|
|
|
|
|
+// videoView.setMediaController(new MediaController(this));
|
|
|
videoView.setVideoURI(uri);
|
|
videoView.setVideoURI(uri);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -190,8 +169,9 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
|
|
|
|
|
//评论
|
|
//评论
|
|
|
public void onClickVideoComment(View view) {
|
|
public void onClickVideoComment(View view) {
|
|
|
- ViewUtil.setVisibility(frame_container, true);
|
|
|
|
|
ViewUtil.setVisibility(video_bottom, false);
|
|
ViewUtil.setVisibility(video_bottom, false);
|
|
|
|
|
+ //跳转评论对话框界面
|
|
|
|
|
+ Jump2View.getInstance().gotoActVideoComment(video_id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private ShareLinkConfig shareLinkConfig;
|
|
private ShareLinkConfig shareLinkConfig;
|
|
@@ -251,16 +231,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onBackPressed() {
|
|
|
|
|
- if (ViewUtil.isVisible(frame_container)) {
|
|
|
|
|
- ViewUtil.setVisibility(frame_container, false);
|
|
|
|
|
- ViewUtil.setVisibility(video_bottom, true);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- super.onBackPressed();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
@Override
|
|
@Override
|
|
|
public void initListener() {
|
|
public void initListener() {
|
|
@@ -291,8 +261,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
initPlay();
|
|
initPlay();
|
|
|
}
|
|
}
|
|
|
loadVideoData(newVideo);
|
|
loadVideoData(newVideo);
|
|
|
- if (fgtVideoComment != null)
|
|
|
|
|
- fgtVideoComment.refreshData();
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -345,8 +313,8 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- protected void onResume() {
|
|
|
|
|
- super.onResume();
|
|
|
|
|
|
|
+ protected void onStart() {
|
|
|
|
|
+ super.onStart();
|
|
|
if (!isPauseByUser)
|
|
if (!isPauseByUser)
|
|
|
play();
|
|
play();
|
|
|
}
|
|
}
|
|
@@ -355,8 +323,8 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
private boolean isPauseByUser;
|
|
private boolean isPauseByUser;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- protected void onPause() {
|
|
|
|
|
- super.onPause();
|
|
|
|
|
|
|
+ protected void onStop() {
|
|
|
|
|
+ super.onStop();
|
|
|
if (videoView != null && videoView.isPlaying())
|
|
if (videoView != null && videoView.isPlaying())
|
|
|
isPauseByUser = false;
|
|
isPauseByUser = false;
|
|
|
if (video_loading != null)
|
|
if (video_loading != null)
|
|
@@ -395,7 +363,6 @@ public class ActPlayVideoArticle extends BaseContainerActivity implements MediaP
|
|
|
LogUtil.println("mGestureListener", "onSingleTapConfirmed");
|
|
LogUtil.println("mGestureListener", "onSingleTapConfirmed");
|
|
|
ViewUtil.toggleVisibility(video_top);
|
|
ViewUtil.toggleVisibility(video_top);
|
|
|
ViewUtil.setVisibility(video_bottom, ViewUtil.isVisible(video_top));
|
|
ViewUtil.setVisibility(video_bottom, ViewUtil.isVisible(video_top));
|
|
|
- ViewUtil.setVisibility(frame_container, false);
|
|
|
|
|
// if(isPlaying)
|
|
// if(isPlaying)
|
|
|
// isPauseByUser = true;
|
|
// isPauseByUser = true;
|
|
|
// playOrPause();
|
|
// playOrPause();
|