From fddad1dd8757bc22c0704b7a84dfe7e20b372fda Mon Sep 17 00:00:00 2001 From: liujing Date: Thu, 22 Oct 2020 14:11:16 +0800 Subject: [PATCH] zancun --- .../scene/road/V2XRoadVideoWindow.java | 33 +++++----- .../src/main/res/layout/window_road_video.xml | 22 +++++-- .../res/layout/window_road_video_item.xml | 62 +++++++++++++++++++ 3 files changed, 98 insertions(+), 19 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/res/layout/window_road_video_item.xml diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java index e18a4955e3..9284c45710 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java @@ -4,6 +4,7 @@ import android.content.Context; import android.graphics.Bitmap; import android.util.AttributeSet; import android.view.LayoutInflater; +import android.view.TextureView; import android.view.View; import android.widget.ImageView; import android.widget.RelativeLayout; @@ -21,6 +22,7 @@ import com.mogo.utils.BitmapHelper; import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder; import java.util.ArrayList; + import static com.mogo.module.v2x.VideoInitKt.initVideo; @@ -53,22 +55,22 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID private void initView(Context context) { LayoutInflater.from(context).inflate(R.layout.window_road_video, this); - initVideo(); - simpleCoverVideoPlayer = findViewById(R.id.roadVideoView);/*播放器*/ + simpleCoverVideoPlayer = this.findViewById(R.id.roadVideoView);/*播放器*/ + TextureView textureView = findViewById(R.id.tex); windowPalyImageView = findViewById(R.id.window_video_play);/*播放键*/ mThumbnailImageView = findViewById(R.id.thumbnail_image);/*第一帧图片*/ - closeImage = findViewById(R.id.roadVideoClose); - closeImage.setOnClickListener(v -> { - close(); - }); - simpleCoverVideoPlayer.setOnClickListener(v -> { - mThumbnailImageView.setVisibility(View.GONE); -// if (simpleCoverVideoPlayer.isPlaying()) { -// videoPause(); -// } else { -// videoResume(); -// } - }); +// closeImage = findViewById(R.id.roadVideoClose); +// closeImage.setOnClickListener(v -> { +// close(); +// }); +// simpleCoverVideoPlayer.setOnClickListener(v -> { +// mThumbnailImageView.setVisibility(View.GONE); +//// if (simpleCoverVideoPlayer.isPlaying()) { +//// videoPause(); +//// } else { +//// videoResume(); +//// } +// }); } @Override @@ -99,9 +101,10 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID * 视频开始播放 * */ private void videoViewStartWithPath(String path) { + initVideo(); simpleCoverVideoPlayer.setVisibility(View.VISIBLE); //加载封面图 -// simpleCoverVideoPlayer.loadCoverImage(path, getContext()); + simpleCoverVideoPlayer.loadCoverImage(path, getContext()); gsyVideoOptionBuilder.setUrl(path).setCacheWithPlay(false).setPlayTag(TAG) .build(simpleCoverVideoPlayer); simpleCoverVideoPlayer.getStartButton().performClick(); diff --git a/modules/mogo-module-v2x/src/main/res/layout/window_road_video.xml b/modules/mogo-module-v2x/src/main/res/layout/window_road_video.xml index e7216d6a89..6c0898cf0f 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/window_road_video.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/window_road_video.xml @@ -14,25 +14,32 @@ android:layout_margin="@dimen/dp_30" app:roundLayoutRadius="@dimen/dp_28"> - + - + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/window_road_video_item.xml b/modules/mogo-module-v2x/src/main/res/layout/window_road_video_item.xml new file mode 100644 index 0000000000..cbfe283897 --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/layout/window_road_video_item.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file