diff --git a/gradle.properties b/gradle.properties index 3d9c247180..9a6fe8a201 100644 --- a/gradle.properties +++ b/gradle.properties @@ -155,21 +155,21 @@ LOGLIB_VERSION = 1.0.4 ######## MogoAiCloudSDK Version # 网络请求 -MOGO_NETWORK_VERSION=1.0.63 +MOGO_NETWORK_VERSION=1.0.66 # 鉴权 -MOGO_PASSPORT_VERSION=1.0.63 +MOGO_PASSPORT_VERSION=1.0.66 # 常链接 -MOGO_SOCKET_VERSION=1.0.63 +MOGO_SOCKET_VERSION=1.0.66 # 数据采集 -MOGO_REALTIME_VERSION=1.0.63 +MOGO_REALTIME_VERSION=1.0.66 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.0.63 +MOGO_TANLU_VERSION=1.0.66 # 直播推流 -MOGO_LIVE_VERSION=1.0.63 +MOGO_LIVE_VERSION=1.0.66 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.0.63 +MOGO_TRAFFICLIVE_VERSION=1.0.66 -######## Foundation MogoAiCloud Moduletruetr +######## Foundation MogoAiCloud Module # mogoAiCloud apk services MOGO_AICLOUD_SERVICES_APK_VERSION=1.0.0-SNAPSHOT # mogoAiCloud sdk services diff --git a/libraries/map-custom/build.gradle b/libraries/map-custom/build.gradle index 2ac43dc030..9f081298c9 100644 --- a/libraries/map-custom/build.gradle +++ b/libraries/map-custom/build.gradle @@ -67,7 +67,7 @@ dependencies { implementation project(':foudations:mogo-commons') } - implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.2' + implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.4' // implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4' } diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewNoLinkageAnimHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewNoLinkageAnimHelper.java index d9b55cfd0a..50974b952c 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewNoLinkageAnimHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewNoLinkageAnimHelper.java @@ -1,14 +1,11 @@ package com.mogo.module.extensions.utils; import android.animation.Animator; -import android.os.Handler; -import android.transition.Transition; import android.util.ArrayMap; import android.view.View; import android.view.ViewGroup.LayoutParams; import androidx.constraintlayout.widget.ConstraintLayout; -import androidx.constraintlayout.widget.ConstraintSet; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.module.common.MogoApisHandler; @@ -36,15 +33,18 @@ public class TopViewNoLinkageAnimHelper { private ConstraintLayout topMotionLayout; private TopView topContainerNoLinkage; - private float topHeight = 0f; + private volatile boolean isTopViewOut = true; + private final List viewCaches = new ArrayList<>(); + private final Map statusListenerMap = new ArrayMap<>(); - private Handler handler = new Handler(); + private View currentAnimatingView = null; + + private IMogoMapUIController mogoMapUIController; + private volatile static TopViewNoLinkageAnimHelper instance = null; private TopViewNoLinkageAnimHelper() { } - private volatile static TopViewNoLinkageAnimHelper instance = null; - public static TopViewNoLinkageAnimHelper getInstance() { if (instance == null) { synchronized (TopViewNoLinkageAnimHelper.class) { @@ -56,8 +56,6 @@ public class TopViewNoLinkageAnimHelper { return instance; } - private IMogoMapUIController mogoMapUIController; - public void setIMogoMapUIController(IMogoMapUIController mogoMapUIController) { this.mogoMapUIController = mogoMapUIController; } @@ -73,12 +71,6 @@ public class TopViewNoLinkageAnimHelper { topContainerNoLinkage.setSlideListener(this::startLatestTopOutAnim); } - private volatile boolean isTopViewOut = true; - private List viewCaches = new ArrayList<>(); - private Map statusListenerMap = new ArrayMap<>(); - - private View currentAnimatingView = null; - public void startTopInAnim(View view, LayoutParams params, IMogoTopViewStatusListener statusListener) { @@ -258,12 +250,12 @@ public class TopViewNoLinkageAnimHelper { topContainerNoLinkage = null; } - public void enterVrMode(){ + public void enterVrMode() { removeAllView(); topContainerNoLinkage.getLayoutParams().width = (int) getDimen(R.dimen.module_ext_top_view_no_link_width_in_vr_mode); } - public void exitVrMode(){ + public void exitVrMode() { removeAllView(); topContainerNoLinkage.getLayoutParams().width = LayoutParams.MATCH_PARENT; } diff --git a/modules/mogo-module-extensions/src/main/res/values/dimens.xml b/modules/mogo-module-extensions/src/main/res/values/dimens.xml index 9cc9dc544b..d430472dff 100644 --- a/modules/mogo-module-extensions/src/main/res/values/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values/dimens.xml @@ -89,7 +89,7 @@ 1058px 822px - 615px + 583px 544px 117px 80px diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarScenario.java index 812f088cdd..2753c14411 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarScenario.java @@ -20,7 +20,7 @@ import com.mogo.utils.TipToast; * author : donghongyu * e-mail : 1358506549@qq.com * date : 2020/5/15 5:37 PM - * desc : TODO 演示使用的推送单车机直播场景 + * desc : TODO 推送直播场景 非演示 * version: 1.0 */ public class V2XPushLiveCarScenario extends AbsV2XScenario implements IMogoTopViewStatusListener { @@ -44,11 +44,9 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario show(); } else { TipToast.shortTip("附近没有可直播车机"); - //Logger.e(V2XConst.MODULE_NAME, "直播地址为null"); } } else { setV2XMessageEntity(v2XMessageEntity); - //Logger.w(V2XConst.MODULE_NAME, "要处理的场景已经存在,丢弃这次初始化"); } } @@ -65,9 +63,15 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario int height = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.module_v2x_event_see_live_window_height_vr : R.dimen.module_v2x_event_see_live_window_height); ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(width, height); - V2XServiceManager - .getMogoTopViewManager() - .addViewNoLinkage(getV2XWindow().getView(), layoutParams, this); + if (V2XServiceManager.getMoGoStatusManager().isVrMode()) { + V2XServiceManager + .getMogoTopViewManager() + .addViewNoLinkage(getV2XWindow().getView(), layoutParams, this); + } else { + V2XServiceManager + .getMogoTopViewManager() + .addView(getV2XWindow().getView(), layoutParams, this); + } getV2XWindow().show(getV2XMessageEntity().getContent()); V2XServiceManager.getMoGoV2XStatusManager().setLiveCarWindowShow(TAG, true); } @@ -111,23 +115,19 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario @Override public void onViewAdded(View view) { - //Logger.d(MODULE_NAME, "展示 Window 动画结束"); ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), getV2XMessageEntity().getContent()); } @Override public void onViewRemoved(View view) { - //Logger.d(MODULE_NAME, "关闭 Window 动画结束"); } @Override public void beforeViewAddAnim(View view) { - //Logger.d(MODULE_NAME, "展示 Window 开始"); } @Override public void beforeViewRemoveAnim(View view) { - //Logger.d(MODULE_NAME, "关闭 Window 开始"); // 重置场景提示的消息 setV2XMessageEntity(null); V2XServiceManager.getMoGoV2XStatusManager().setLiveCarWindowShow(TAG, false); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java index 5c1675c924..2b07ee047e 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java @@ -6,6 +6,7 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; @@ -19,7 +20,6 @@ import com.mogo.module.v2x.scenario.view.IV2XWindow; import com.mogo.module.v2x.utils.MarkerUtils; import com.mogo.module.v2x.view.V2XLiveGSYVideoView; import com.mogo.service.imageloader.MogoImageView; -import com.mogo.utils.logger.Logger; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; @@ -27,20 +27,18 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME; * author : donghongyu * e-mail : 1358506549@qq.com * date : 2020/4/24 11:34 AM - * desc : TODO 演示使用的推送单车机直播场景 * version: 1.0 */ public class V2XPushLiveCarWindow extends V2XBasWindow implements IV2XWindow { - private Context mContext; private V2XLiveGSYVideoView mV2XLiveGSYVideoView; private MogoImageView mIvReportHead; - private ImageView pushVideoClose; + // 弹窗状态监听 private V2XWindowStatusListener mV2XWindowStatusListener; // 直播30秒自动关闭 - private static Handler handlerV2XEvent = new Handler(); + private static final Handler handlerV2XEvent = new Handler(); private static Runnable runnableV2XEvent; public V2XPushLiveCarWindow() { @@ -57,17 +55,18 @@ public class V2XPushLiveCarWindow extends V2XBasWindow implements IV2XWindow { //移除窗体 V2XServiceManager @@ -114,7 +113,7 @@ public class V2XPushLiveCarWindow extends V2XBasWindow implements IV2XWindow { @@ -106,8 +106,7 @@ public class V2XVoiceCallLiveBiz { LiveStreamManagerImpl.getInstance(AbsMogoApplication.getApp(), MoGoAiCloudClientConfig.getInstance().getThirdPartyDeviceId()); V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, null); - mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario(); - mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCallLiveCarWindow()); + V2XVoiceCallLiveScenario mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario(); mV2XVoiceCallLiveScenario.init(v2XMessageEntity); } @@ -121,11 +120,11 @@ public class V2XVoiceCallLiveBiz { public void liveUrlResult(String liveUrl) { if (!TextUtils.isEmpty(liveUrl)) { V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, liveUrl); - mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario(); - mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCrossRoadLiveWindow()); - mV2XVoiceCallLiveScenario.init(v2XMessageEntity); + V2XPushLiveCarScenario pushLiveCarScenario = new V2XPushLiveCarScenario(); + pushLiveCarScenario.init(v2XMessageEntity); } else { Logger.d(MODULE_NAME, "getOpenRoadCameraLive 路口实况直播地址为空"); + ToastUtils.showShort(R.string.v2x_front_live_url_null); } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java index c836ca0c47..0b06069949 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveCarWindow.java @@ -4,7 +4,6 @@ import android.content.Context; import android.os.Handler; import android.util.AttributeSet; import android.view.LayoutInflater; -import android.view.SurfaceView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; @@ -24,7 +23,10 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME; public class V2XVoiceCallLiveCarWindow extends V2XBasWindow implements IV2XWindow { - private CarZegoLiveVideoView mV2XCarLiveVideoView; + private static final int COUNT_DOWN_TIMER = 1_000; + private static final int ALL_EXPIRE_TIMER = 1_000 * 30; + private static int EXPIRE_TIMER = ALL_EXPIRE_TIMER; + private TextView tvCountDown; private ImageView ivVideoPlayingSign; private boolean isVideoPlay = false; @@ -32,13 +34,9 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow // 处理道路事件,30秒倒计时 private final Handler handlerV2XEvent = new Handler(); private Runnable runnableV2XEvent; - private static final int COUNT_DOWN_TIMER = 1_000; - private static final int ALL_EXPIRE_TIMER = 1_000 * 30; - private static int EXPIRE_TIMER = ALL_EXPIRE_TIMER; public V2XVoiceCallLiveCarWindow() { this(V2XServiceManager.getContext(), null); - Logger.d(MODULE_NAME, "V2XVoiceCallLiveCarWindow INIT"); } public V2XVoiceCallLiveCarWindow(Context context, AttributeSet attrs) { @@ -52,8 +50,10 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow private void initView(Context context) { Logger.w(MODULE_NAME, "V2X===初始化语音呼叫直播视图"); - LayoutInflater.from(context).inflate(R.layout.window_see_carlive_video, this); - mV2XCarLiveVideoView = findViewById(R.id.videoPlayer); + LayoutInflater.from(context).inflate(V2XServiceManager.getMoGoStatusManager().isVrMode() + ? R.layout.window_see_carlive_video_vr + : R.layout.window_see_carlive_video, this); + CarZegoLiveVideoView mV2XCarLiveVideoView = findViewById(R.id.videoPlayer); tvCountDown = findViewById(R.id.tvCountDown); ivVideoPlayingSign = findViewById(R.id.ivVideoPlayingSign); mV2XCarLiveVideoView.addOnVideoStatusChangeListener(videoPlaying -> { @@ -113,7 +113,6 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow if (runnableV2XEvent == null) { runnableV2XEvent = () -> { EXPIRE_TIMER = EXPIRE_TIMER - COUNT_DOWN_TIMER; - Logger.d(MODULE_NAME, "V2X=== Window 30秒倒计时开始,当前 :" + EXPIRE_TIMER / COUNT_DOWN_TIMER + " 秒"); tvCountDown.setVisibility(View.VISIBLE); ivVideoPlayingSign.setVisibility(View.VISIBLE); tvCountDown.setText(String.valueOf(EXPIRE_TIMER / COUNT_DOWN_TIMER)); @@ -126,12 +125,10 @@ public class V2XVoiceCallLiveCarWindow extends V2XBasWindow } else { handlerV2XEvent.removeCallbacks(runnableV2XEvent); } - Logger.d(MODULE_NAME, "V2X=== Window 展示开始倒计时"); handlerV2XEvent.postDelayed(runnableV2XEvent, COUNT_DOWN_TIMER); } private void stopCountDown() { - Logger.d(MODULE_NAME, "V2X=== Window 倒计时停止。。。"); if (handlerV2XEvent != null && runnableV2XEvent != null) { handlerV2XEvent.removeCallbacks(runnableV2XEvent); runnableV2XEvent = null; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveScenario.java index a802d93962..1b7c047ccd 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveScenario.java @@ -1,7 +1,7 @@ package com.mogo.module.v2x.scenario.scene.livecar; import android.view.View; -import android.widget.RelativeLayout; +import android.view.ViewGroup; import androidx.annotation.Nullable; @@ -20,27 +20,26 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME; /** * author : unknown - * desc : 语音呼叫查看直播场景,包括车辆直播 或者 路口实况 window,区分不同页面window逻辑实现 + * desc : 语音呼叫查看直播场景,包括车辆直播 或者 路口实况 window,区分不同页面window逻辑实现,前方直播车辆由AICloudSdk中实现,上层仅传入SurfaceView和经纬度 */ public class V2XVoiceCallLiveScenario extends AbsV2XScenario implements IMogoTopViewStatusListener { + public V2XVoiceCallLiveScenario() { + setV2XWindow(new V2XVoiceCallLiveCarWindow()); + } + @Override public void init(@Nullable V2XMessageEntity v2XMessageEntity) { if (v2XMessageEntity == null) { TipToast.shortTip("附近没有可直播车机"); + return; } if (v2XMessageEntity.isShowState()) { if (!isSameScenario(v2XMessageEntity) && V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) { setV2XMessageEntity(v2XMessageEntity); - Logger.d(V2XConst.MODULE_NAME, "v2XMessageEntity : " + v2XMessageEntity + " getVideoSn : " + v2XMessageEntity.getContent().getVideoSn()); - if (v2XMessageEntity != null) { - Logger.d(V2XConst.MODULE_NAME, "准备展示直播窗口"); - show(); - } else { - TipToast.shortTip("附近没有可直播车机"); - Logger.e(V2XConst.MODULE_NAME, "直播地址为null"); - } + Logger.d(V2XConst.MODULE_NAME, "v2XMessageEntity : " + v2XMessageEntity); + show(); } else { setV2XMessageEntity(v2XMessageEntity); Logger.w(V2XConst.MODULE_NAME, "要处理的场景已经存在,丢弃这次初始化"); @@ -64,11 +63,7 @@ public class V2XVoiceCallLiveScenario extends AbsV2XScenario { mLoading.setVisibility(VISIBLE); mClLoadError.setVisibility(GONE); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java index ecd7605263..0a6fef8f20 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XCrossRoadVideoView.java @@ -57,7 +57,6 @@ public class V2XCrossRoadVideoView extends RoundLayout { private final GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder(); private ProgressBar mLoading; private ConstraintLayout mClLoadError; - private TextView mTvRefreshButton; private boolean init = false; private MarkerCarInfo.CarLiveInfo mCarLiveInfo; @@ -83,6 +82,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { public V2XCrossRoadVideoView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); + Logger.d(TAG, "constructor invoke initView"); initView(context); } @@ -101,7 +101,7 @@ public class V2XCrossRoadVideoView extends RoundLayout { mLoading.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(context, R.color.live_video_progress_bar_loading_color), PorterDuff.Mode.MULTIPLY); mClLoadError = findViewById(R.id.clLoadError); - mTvRefreshButton = findViewById(R.id.tvRefreshButton); + TextView mTvRefreshButton = findViewById(R.id.tvRefreshButton); mTvRefreshButton.setOnClickListener(v -> { mLoading.setVisibility(VISIBLE); mClLoadError.setVisibility(GONE); @@ -152,7 +152,6 @@ public class V2XCrossRoadVideoView extends RoundLayout { * @param carLiveInfo 要直播的设备信息,如果没有直播的地址需要重新获取最新的直播地址 */ public void startLive(MarkerCarInfo.CarLiveInfo carLiveInfo) { - initView(this.getContext()); // 进行直播播放 if (mTxcVideoView != null && carLiveInfo != null) { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XLiveGSYVideoView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XLiveGSYVideoView.java index 205b9d43d5..10d9618c44 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XLiveGSYVideoView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XLiveGSYVideoView.java @@ -7,7 +7,6 @@ import android.os.Bundle; import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; -import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; @@ -18,8 +17,6 @@ import com.mogo.commons.voice.AIAssist; import com.mogo.module.common.entity.MarkerCarInfo; import com.mogo.module.v2x.R; import com.mogo.module.v2x.V2XServiceManager; -import com.mogo.module.v2x.entity.net.V2XLivePushVoRes; -import com.mogo.module.v2x.network.V2XRefreshCallback; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.module.v2x.voice.V2XVoiceCallbackListener; import com.mogo.module.v2x.voice.V2XVoiceConstants; @@ -50,16 +47,14 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS private ProgressBar mLoading; private TXLivePlayer mLivePlayer; private ConstraintLayout mClLoadError; - private TextView mTvRefreshButton; - private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper; + private final MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper; private MarkerCarInfo.CarLiveInfo mCarLiveInfo; // 重新刷新直播流 - private V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() { + private final V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() { @Override public void onCallback(String command, Intent intent) { - //startHeartLive(mCarLiveInfo); mLoading.setVisibility(VISIBLE); mClLoadError.setVisibility(GONE); if (mCarLiveInfo != null) { @@ -87,7 +82,7 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS private void initView(Context context) { LayoutInflater.from(context) .inflate(R.layout.view_video_layout_normal, this); - //mPlayerView 即 step1 中添加的界面 view + //mPlayerView 即 step1 中添加的界面 view mTxcVideoView = findViewById(R.id.txcVideoView); //创建 player 对象 mLivePlayer = new TXLivePlayer(context); @@ -106,15 +101,12 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS mLoading.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(context, R.color.live_video_progress_bar_loading_color), PorterDuff.Mode.MULTIPLY); mClLoadError = findViewById(R.id.clLoadError); - mTvRefreshButton = findViewById(R.id.tvRefreshButton); - mTvRefreshButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - mLoading.setVisibility(VISIBLE); - mClLoadError.setVisibility(GONE); - if (mCarLiveInfo != null) { - startLive(mCarLiveInfo); - } + TextView mTvRefreshButton = findViewById(R.id.tvRefreshButton); + mTvRefreshButton.setOnClickListener(v -> { + mLoading.setVisibility(VISIBLE); + mClLoadError.setVisibility(GONE); + if (mCarLiveInfo != null) { + startLive(mCarLiveInfo); } }); } @@ -141,33 +133,33 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS } // 根据SN重新获取直播流地址 else { - V2XServiceManager - .getV2XRefreshModel() - .livePush(new V2XRefreshCallback() { - @Override - public void onSuccess(V2XLivePushVoRes result) { - Logger.e(MODULE_NAME, "从服务端获取最新直播信息:" + GsonUtil.jsonFromObject(result)); - mClLoadError.setVisibility(GONE); - mClLoadError.setVisibility(GONE); - try { - MarkerCarInfo.CarLiveInfo carRealLiveInfo = new MarkerCarInfo.CarLiveInfo(); - carRealLiveInfo.setVideoUrl(result.getResult().getPlayUrl().getRtmp()); - carRealLiveInfo.setVideoSn(carLiveInfo.getVideoSn()); - carRealLiveInfo.setVideoChannel(result.getResult().getVideoChannel()); - setCarLiveInfo(carLiveInfo); - playLiveVideo(carRealLiveInfo); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String msg) { - Logger.e(MODULE_NAME, "播放器:" + msg); - mLoading.setVisibility(GONE); - mClLoadError.setVisibility(VISIBLE); - } - }, carLiveInfo.getVideoSn(), 0); +// V2XServiceManager +// .getV2XRefreshModel() +// .livePush(new V2XRefreshCallback() { +// @Override +// public void onSuccess(V2XLivePushVoRes result) { +// Logger.e(MODULE_NAME, "从服务端获取最新直播信息:" + GsonUtil.jsonFromObject(result)); +// mClLoadError.setVisibility(GONE); +// mClLoadError.setVisibility(GONE); +// try { +// MarkerCarInfo.CarLiveInfo carRealLiveInfo = new MarkerCarInfo.CarLiveInfo(); +// carRealLiveInfo.setVideoUrl(result.getResult().getPlayUrl().getRtmp()); +// carRealLiveInfo.setVideoSn(carLiveInfo.getVideoSn()); +// carRealLiveInfo.setVideoChannel(result.getResult().getVideoChannel()); +// setCarLiveInfo(carLiveInfo); +// playLiveVideo(carRealLiveInfo); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// +// @Override +// public void onFail(String msg) { +// Logger.e(MODULE_NAME, "播放器:" + msg); +// mLoading.setVisibility(GONE); +// mClLoadError.setVisibility(VISIBLE); +// } +// }, carLiveInfo.getVideoSn(), 0); } } } @@ -223,7 +215,7 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS /** * 刷新直播心跳 * - * @param carLiveInfo + * @param carLiveInfo 直播info */ private void startHeartLive(MarkerCarInfo.CarLiveInfo carLiveInfo) { try { @@ -248,20 +240,25 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS // true 代表清除最后一帧画面 mLivePlayer.stopPlay(true); mTxcVideoView.onDestroy(); - // 停止推流 - V2XServiceManager - .getV2XRefreshModel() - .livePush(new V2XRefreshCallback() { - @Override - public void onSuccess(V2XLivePushVoRes result) { - Logger.d(MODULE_NAME, "播放器:" + result); - } - @Override - public void onFail(String msg) { - Logger.e(MODULE_NAME, "播放器:" + msg); - } - }, carLiveInfo.getVideoSn(), 1); +// if (carLiveInfo.getVideoUrl() != null) { +// return; +// } + + // 停止推流 +// V2XServiceManager +// .getV2XRefreshModel() +// .livePush(new V2XRefreshCallback() { +// @Override +// public void onSuccess(V2XLivePushVoRes result) { +// Logger.d(MODULE_NAME, "播放器:" + result); +// } +// +// @Override +// public void onFail(String msg) { +// Logger.e(MODULE_NAME, "播放器:" + msg); +// } +// }, carLiveInfo.getVideoSn(), 1); } catch (Exception e) { e.printStackTrace(); } diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_live_video.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_live_video.xml index e170be569a..64f8db6ea4 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_live_video.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_live_video.xml @@ -10,7 +10,7 @@ \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_push_live_video_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_push_live_video_vr.xml new file mode 100644 index 0000000000..b02a2d05fc --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_push_live_video_vr.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_see_frontcar_live_video.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_see_frontcar_live_video.xml index 5296ed1c01..09a73bd6ff 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_see_frontcar_live_video.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_see_frontcar_live_video.xml @@ -1,13 +1,11 @@ + app:roundLayoutRadius="@dimen/dp_30"> + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml index 9a5eda56df..73a2019ecc 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_crossroad.xml @@ -1,5 +1,5 @@ - - - + diff --git a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_live.xml b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_live.xml index e25f343eb8..bd902cb049 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_live.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_see_live.xml @@ -4,8 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/rlRoadEventList" android:layout_width="match_parent" - android:layout_height="@dimen/v2x_video_window_height_content" - android:layout_margin="@dimen/dp_15"> + android:layout_height="match_parent"> + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml index 807411620e..fad6a35bf5 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml @@ -2,10 +2,12 @@ 800px + 615px 32px 32px 1060px 583px + 366px 160px 0px 32px @@ -14,7 +16,7 @@ 410px 670px - 366px + 526px 147px 60px 40px diff --git a/modules/mogo-module-v2x/src/main/res/values/strings.xml b/modules/mogo-module-v2x/src/main/res/values/strings.xml index 386b36333a..f2c31b1fe4 100644 --- a/modules/mogo-module-v2x/src/main/res/values/strings.xml +++ b/modules/mogo-module-v2x/src/main/res/values/strings.xml @@ -16,5 +16,6 @@ 停车场推荐 线路推荐 26px + 前方路口暂无直播