[6.8.0][驾驶位视频流] 代码提交
This commit is contained in:
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -155,6 +156,42 @@ class TeleMsgHandler : IMsgHandler {
|
||||
}
|
||||
return
|
||||
}
|
||||
if (it.protocolType == TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_REQ) {
|
||||
try {
|
||||
Log.d(TAG, "乘客屏收到司机屏转发的驾驶位视频流开关 --- 1 ---")
|
||||
val content = String(it.body, Charset.defaultCharset())
|
||||
Log.d(TAG, "乘客屏收到司机屏转发的驾驶位视频流开关 --- 2 ---:$content")
|
||||
val data = GsonUtils.fromJson(content, Map::class.java)
|
||||
val open = data["open"].toString().toInt() == 1
|
||||
val playUrl = data["playUrl"]?.toString()
|
||||
//TODO yangyakun
|
||||
if (open) {
|
||||
if (playUrl != null) {
|
||||
// 1. 获取视频播放控件
|
||||
val target = CallerDevaToolsManager.driveSeatVideoProvider()?.getDriveVideoView(playUrl) { event ->
|
||||
|
||||
}
|
||||
|
||||
if (target != null) {
|
||||
// 2. 添加到一个ViewGroup上
|
||||
// 11: 第1个1代表运营面板开关打开,第2个1代表打开成功,告之司机端
|
||||
// 10: 第1个1代表运营面板开关打开,第2个0代表打开成功,告之司机端
|
||||
CallerTelematicManager.sendMsgToServer(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_RSP, "11".toByteArray())
|
||||
}
|
||||
|
||||
} else {
|
||||
CallerTelematicManager.sendMsgToServer(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_RSP, "10".toByteArray())
|
||||
}
|
||||
} else {
|
||||
//第1个0代表运营面板开关关闭,第2个1代表关闭成功,告之司机端; 相应的还有状态:00表示关闭失败
|
||||
CallerTelematicManager.sendMsgToServer(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_RSP, "01".toByteArray())
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
Log.e(TAG, "乘客屏收到司机屏转发的驾驶位视频流开关--- 3 ---", t)
|
||||
}
|
||||
return
|
||||
}
|
||||
when (it.protocolType) {
|
||||
MogoProtocolMsg.NORMAL_DATA -> {
|
||||
try {
|
||||
@@ -349,6 +386,11 @@ class TeleMsgHandler : IMsgHandler {
|
||||
)
|
||||
}
|
||||
|
||||
TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_RSP -> {
|
||||
// 来自客户端的响应
|
||||
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.DRIVE_SEAT_VIDEO_STREAM_RSP, it.body)
|
||||
}
|
||||
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user