|
|
@@ -94,6 +94,7 @@ public class ActVideoDetail extends BaseUMActivity implements MediaPlayer.OnInfo
|
|
|
private int video_id;
|
|
|
private int user_id;
|
|
|
private String video_url;
|
|
|
+ private int orientation = 0;
|
|
|
private DiscoveryVideo newVideo;
|
|
|
private ArrayList<DiscoveryVideo> videoList;
|
|
|
private int position;
|
|
|
@@ -117,6 +118,7 @@ public class ActVideoDetail extends BaseUMActivity implements MediaPlayer.OnInfo
|
|
|
video_id = lastVideo.getId();
|
|
|
user_id = lastVideo.getUser_id();
|
|
|
video_url = lastVideo.getResource();
|
|
|
+ orientation = lastVideo.getOrientation();
|
|
|
loadVideoData(lastVideo);
|
|
|
}
|
|
|
|
|
|
@@ -144,6 +146,12 @@ public class ActVideoDetail extends BaseUMActivity implements MediaPlayer.OnInfo
|
|
|
videoView.setOnCompletionListener(this);
|
|
|
// videoView.setMediaController(new MediaController(this));
|
|
|
videoView.setVideoURI(getUri());
|
|
|
+ resetVideoOrientation();
|
|
|
+ }
|
|
|
+ //重新设置视频的方向,videoView没法设置方向
|
|
|
+ private void resetVideoOrientation(){
|
|
|
+// if(orientation > 0 && orientation < 360)
|
|
|
+// videoView.setRotation(orientation);
|
|
|
}
|
|
|
//转化地址
|
|
|
private Uri getUri(){
|
|
|
@@ -311,7 +319,11 @@ public class ActVideoDetail extends BaseUMActivity implements MediaPlayer.OnInfo
|
|
|
@Override
|
|
|
protected void onResume() {
|
|
|
super.onResume();
|
|
|
- //更新评论数量
|
|
|
+ updateVideoCommentNo();
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新评论数量
|
|
|
+ private void updateVideoCommentNo() {
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().getGameUserAppCommentList(1,1, video_id, ApiJSONUtil.COMMENT_TYPE_VIDEO)
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
@@ -471,6 +483,7 @@ public class ActVideoDetail extends BaseUMActivity implements MediaPlayer.OnInfo
|
|
|
videoView.setVideoURI(getUri());
|
|
|
videoView.requestFocus();
|
|
|
updateVideo();
|
|
|
+ updateVideoCommentNo();
|
|
|
}
|
|
|
} else if (event2.getX() - event1.getX() > FLING_MIN_DISTANCE
|
|
|
&& Math.abs(velocityX) > FLING_MIN_VELOCITY) {
|
|
|
@@ -488,6 +501,7 @@ public class ActVideoDetail extends BaseUMActivity implements MediaPlayer.OnInfo
|
|
|
videoView.setVideoURI(getUri());
|
|
|
videoView.requestFocus();
|
|
|
updateVideo();
|
|
|
+ updateVideoCommentNo();
|
|
|
}
|
|
|
} else if (event2.getY() - event1.getY() > FLING_MIN_DISTANCE
|
|
|
&& Math.abs(velocityY) > FLING_MIN_VELOCITY) {
|