优化了点击道路事件的视频播放方式
This commit is contained in:
@@ -57,9 +57,14 @@ public class V2XRoadVideoCarScenario extends AbsV2XScenario<V2XEventShowEntity>
|
||||
public void showWindow() {
|
||||
if (getV2XWindow() != null) {
|
||||
getV2XWindow().show(getV2XMessageEntity().getContent());
|
||||
ViewGroup.LayoutParams layoutParams =
|
||||
new ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(int) V2XUtils.getApp().getResources()
|
||||
.getDimension(R.dimen.v2x_video_window_height));
|
||||
V2XServiceManager
|
||||
.getIMogoWindowManager()
|
||||
.addView(getV2XWindow().getView(), 0, 0, false);
|
||||
.getMogoTopViewManager()
|
||||
.addViewNoLinkage(getV2XWindow().getView(), layoutParams, this);
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setV2XAnimationWindowShow(TAG, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,10 +30,11 @@ import java.util.ArrayList;
|
||||
import static com.mogo.module.v2x.VideoInitKt.initVideo;
|
||||
import static com.shuyu.gsyvideoplayer.utils.GSYVideoType.SCREEN_MATCH_FULL;
|
||||
|
||||
/*
|
||||
https://github.com/CarGuo/GSYVideoPlayer/tree/master/doc SimpleCoverVideoPlayer文档
|
||||
* */
|
||||
public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, IDestroyable, VideoAdapterCallBack {
|
||||
/**
|
||||
https://github.com/CarGuo/GSYVideoPlayer/tree/master/doc SimpleCoverVideoPlayer文档
|
||||
*/
|
||||
public class V2XRoadVideoWindow extends RelativeLayout implements
|
||||
IV2XWindow, IDestroyable, VideoAdapterCallBack {
|
||||
|
||||
private static final String TAG = "V2XRoadVideoWindow";
|
||||
private V2XWindowStatusListener mV2XWindowStatusListener;
|
||||
@@ -92,9 +93,9 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 开始播放
|
||||
* */
|
||||
*/
|
||||
private void startPlayWithVideoUrl(String videoUrl) {
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
.build(simpleCoverVideoPlayer);
|
||||
@@ -103,9 +104,9 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID
|
||||
playImageView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 暂停
|
||||
* */
|
||||
*/
|
||||
private void pause() {
|
||||
playImageView.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
@@ -117,18 +118,18 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 继续
|
||||
* */
|
||||
*/
|
||||
private void resume() {
|
||||
playImageView.setImageResource(R.drawable.v2x_video_pause);
|
||||
playImageView.setVisibility(View.GONE);
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 播放结束后
|
||||
* */
|
||||
*/
|
||||
private void complete(Bitmap firstbitmap, String path) {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setImageBitmap(firstbitmap);
|
||||
@@ -262,8 +263,8 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow, ID
|
||||
public void close() {
|
||||
//移除窗体
|
||||
V2XServiceManager
|
||||
.getIMogoWindowManager()
|
||||
.removeView(this);
|
||||
.getMogoTopViewManager()
|
||||
.removeViewNoLinkage(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user