「dev_sop_2.14.4」

1、修复直播状态回调问题
This commit is contained in:
donghongyu
2023-04-13 13:05:02 +08:00
parent 7d876fbfd8
commit de04c9a23e
8 changed files with 70 additions and 82 deletions

View File

@@ -214,12 +214,7 @@ class CameraListView : FrameLayout {
}
}
}
liveStreamManager.setLiveStatusChangeCallback {
textureView
.post {
handleSnLiveStatus(it)
}
}
}
private fun isCarLive(): Boolean {
@@ -237,17 +232,6 @@ class CameraListView : FrameLayout {
}
}
private fun handleSnLiveStatus(status: Int) {
when (status) {
0 -> {// 正在直播
}
1 -> {// 直播已停止
}
2 -> {// 直播强制结束
}
}
}
private val trafficCarLiveCallBack = object : ITrafficCarLiveCallBack {
override fun onLive(liveSn: String?) {
CallerLogger.d("$M_HMI$TAG", "onLive")
@@ -291,6 +275,14 @@ class CameraListView : FrameLayout {
}
}
}
override fun onPlaying() {
}
override fun onPlaRequesting() {
}
}
fun updateCameraData(cameraInfoList: List<CameraEntity>?) {
@@ -337,7 +329,6 @@ class CameraListView : FrameLayout {
if (valueAnimator.isStarted || valueAnimator.isRunning) {
valueAnimator.cancel()
}
liveStreamManager.setLiveStatusChangeCallback(null)
}
private fun stopLive() {

View File

@@ -15,7 +15,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.widget.RoundConstraintLayout
import kotlinx.android.synthetic.main.view_camera_list.view.*
import kotlinx.android.synthetic.main.view_driver_monitor.view.*
/**
@@ -79,12 +78,7 @@ class DriverMonitorView :
textureViewDriverMonitor.isOpaque = false
liveStreamManager.setLiveStatusChangeCallback {
textureView
.post {
handleSnLiveStatus(it)
}
}
liveStreamManager.setLivePushStatusChangeCallback { }
// TODO SOP演示需求只有乘客屏幕才会触发这个逻辑 begin
// 测试数据
@@ -116,26 +110,26 @@ class DriverMonitorView :
fun showLive() {
if (!isLived) {
sopShowDriverMap[CallerTelematicManager.getServerToken()]?.let {
Logger.d(
"${SceneConstant.M_HMI}$TAG",
"检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
)
CallerLogger.d(
"${SceneConstant.M_HMI}$TAG",
"检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
)
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
it,
textureViewDriverMonitor,
carLiveCallBack
)
}
// MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
// "F803EB2046PZD00190",
// textureViewDriverMonitor,
// carLiveCallBack
// )
// sopShowDriverMap[CallerTelematicManager.getServerToken()]?.let {
// Logger.d(
// "${SceneConstant.M_HMI}$TAG",
// "检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
// )
// CallerLogger.d(
// "${SceneConstant.M_HMI}$TAG",
// "检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
// )
// MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
// it,
// textureViewDriverMonitor,
// carLiveCallBack
// )
// }
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
"F803EB2046PZD00164",
textureViewDriverMonitor,
carLiveCallBack
)
}
}
@@ -151,32 +145,10 @@ class DriverMonitorView :
}
}
private fun handleSnLiveStatus(status: Int) {
when (status) {
0 -> {// 正在直播
isLived = true
}
1 -> {// 直播已停止
isLived = false
}
2 -> {// 直播强制结束
isLived = false
}
}
refreshView(isLived)
Logger.d("${SceneConstant.M_HMI}$TAG", "isLived:$isLived")
CallerLogger.d("${SceneConstant.M_HMI}$TAG", "isLived:$isLived")
}
private val carLiveCallBack = object : ITrafficCarLiveCallBack {
override fun onLive(liveSn: String?) {
Logger.d("${SceneConstant.M_HMI}$TAG", "onLive:$liveSn")
CallerLogger.d("${SceneConstant.M_HMI}$TAG", "onLive:$liveSn")
isLived = true
refreshView(isLived)
}
override fun onFirstFrame() {
@@ -199,6 +171,18 @@ class DriverMonitorView :
isLived = false
refreshView(isLived)
}
override fun onPlaying() {
Logger.e("${SceneConstant.M_HMI}$TAG", "onPlaying……")
isLived = true
refreshView(isLived)
}
override fun onPlaRequesting() {
Logger.e("${SceneConstant.M_HMI}$TAG", "onPlaRequesting……")
isLived = false
refreshView(isLived)
}
}
}

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360"
android:drawable="@drawable/icon_loading_live">
</rotate>

View File

@@ -3,7 +3,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rclContainer"
android:layout_width="match_parent"
android:background="#FFF"
android:layout_height="match_parent"
app:roundLayoutRadius="24dp">
@@ -11,7 +10,6 @@
android:id="@+id/ivNormal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bus_picture_nor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -22,6 +20,7 @@
android:id="@+id/textureViewDriverMonitor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -31,7 +30,11 @@
android:id="@+id/liveProgressBar"
android:layout_width="90dp"
android:layout_height="90dp"
android:indeterminateDrawable="@drawable/icon_loading_live"
android:indeterminate="true"
android:indeterminateBehavior="repeat"
android:indeterminateDuration="2000"
android:indeterminateDrawable="@anim/progressbar_drawable"
android:indeterminateOnly="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -41,7 +44,7 @@
android:id="@+id/tvLoadingHit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginTop="24dp"
android:text="加载中……"
android:textColor="#2D3E5F"
android:textSize="28dp"