|
@@ -4,6 +4,7 @@ import android.app.Activity;
|
|
import android.content.pm.ActivityInfo;
|
|
import android.content.pm.ActivityInfo;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
|
+import android.widget.Button;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.Nullable;
|
|
@@ -12,6 +13,7 @@ import com.shuyu.gsyvideoplayer.GSYVideoManager;
|
|
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
|
|
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
|
|
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
|
|
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
|
|
import com.xunao.effectdemo.R;
|
|
import com.xunao.effectdemo.R;
|
|
|
|
+import com.xunao.effectdemo.view.VideoPreviewPlay;
|
|
|
|
|
|
/**
|
|
/**
|
|
* author : 程中强
|
|
* author : 程中强
|
|
@@ -22,8 +24,10 @@ import com.xunao.effectdemo.R;
|
|
*/
|
|
*/
|
|
public class GSXYVideoPlayerActivity extends Activity {
|
|
public class GSXYVideoPlayerActivity extends Activity {
|
|
|
|
|
|
- StandardGSYVideoPlayer videoPlayer;
|
|
|
|
|
|
+ VideoPreviewPlay videoPlayer;
|
|
private OrientationUtils orientationUtils;
|
|
private OrientationUtils orientationUtils;
|
|
|
|
+ private Button btn;
|
|
|
|
+ private boolean isFirst = false;
|
|
private String url = "http://v3.cztv.com/cztv/vod/2018/06/28/7c45987529ea410dad7c088ba3b53dac/h264_1500k_mp4.mp4";
|
|
private String url = "http://v3.cztv.com/cztv/vod/2018/06/28/7c45987529ea410dad7c088ba3b53dac/h264_1500k_mp4.mp4";
|
|
@Override
|
|
@Override
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -40,10 +44,24 @@ public class GSXYVideoPlayerActivity extends Activity {
|
|
//增加title
|
|
//增加title
|
|
videoPlayer.getTitleTextView().setVisibility(View.GONE);
|
|
videoPlayer.getTitleTextView().setVisibility(View.GONE);
|
|
//设置返回键
|
|
//设置返回键
|
|
- videoPlayer.getBackButton().setVisibility(View.GONE);
|
|
|
|
|
|
+ videoPlayer.getBackButton().setOnClickListener(v->{
|
|
|
|
+ finish();
|
|
|
|
+ });
|
|
videoPlayer.getFullscreenButton().setVisibility(View.GONE);
|
|
videoPlayer.getFullscreenButton().setVisibility(View.GONE);
|
|
orientationUtils = new OrientationUtils(this, videoPlayer);
|
|
orientationUtils = new OrientationUtils(this, videoPlayer);
|
|
|
|
+ videoPlayer.setIsFinish(isFirst);
|
|
|
|
+ videoPlayer.setIsTouchWiget(isFirst);
|
|
|
|
+ videoPlayer.setIsTouchWigetFull(isFirst);
|
|
|
|
+ videoPlayer.setIfCurrentIsFullscreen(false);
|
|
videoPlayer.startPlayLogic();
|
|
videoPlayer.startPlayLogic();
|
|
|
|
+
|
|
|
|
+ btn = findViewById(R.id.btn_finish);
|
|
|
|
+ btn.setOnClickListener(v->{
|
|
|
|
+ isFirst = !isFirst;
|
|
|
|
+ videoPlayer.setIsFinish(isFirst);
|
|
|
|
+// videoPlayer.setIsTouchWiget(isFirst);
|
|
|
|
+// videoPlayer.setIsTouchWigetFull(isFirst);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -66,15 +84,15 @@ public class GSXYVideoPlayerActivity extends Activity {
|
|
orientationUtils.releaseListener();
|
|
orientationUtils.releaseListener();
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void onBackPressed() {
|
|
|
|
- //先返回正常状态
|
|
|
|
- if (orientationUtils.getScreenType() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
|
|
|
- videoPlayer.getFullscreenButton().performClick();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- //释放所有
|
|
|
|
- videoPlayer.setVideoAllCallBack(null);
|
|
|
|
- super.onBackPressed();
|
|
|
|
- }
|
|
|
|
|
|
+// @Override
|
|
|
|
+// public void onBackPressed() {
|
|
|
|
+// //先返回正常状态
|
|
|
|
+// if (orientationUtils.getScreenType() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
|
|
|
|
+// videoPlayer.getFullscreenButton().performClick();
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// //释放所有
|
|
|
|
+// videoPlayer.setVideoAllCallBack(null);
|
|
|
|
+// super.onBackPressed();
|
|
|
|
+// }
|
|
}
|
|
}
|