[Update]更新zego直播相关sdk的版本

This commit is contained in:
chenfufeng
2021-11-26 16:49:52 +08:00
parent 9e4a8a9606
commit 8708327e51
5 changed files with 32 additions and 15 deletions

View File

@@ -67,7 +67,8 @@ class CameraListView : FrameLayout {
private val liveStreamManager by lazy {
LiveStreamManagerImpl.getInstance(
context.applicationContext as Application?,
MoGoAiCloudClientConfig.getInstance().sn
MoGoAiCloudClientConfig.getInstance().sn,
false
)
}
private var liveSn: String? = ""
@@ -336,11 +337,16 @@ class CameraListView : FrameLayout {
try {
GSYVideoManager.releaseAllVideos()
} catch (e: Exception) {
Logger.e(TAG, "stopLive exception msg is:${e.message},cause is:${e.cause}")
e.printStackTrace()
}
}
else -> {
if (!liveSn.isNullOrEmpty()) MoGoAiCloudTrafficLive.stopCarLive(liveSn)
if (!liveSn.isNullOrEmpty()) {
MoGoAiCloudTrafficLive.stopCarLive(liveSn)
} else {
Logger.d(TAG, "StopCarLive sn is null or empty!")
}
}
}
}

View File

@@ -20,6 +20,7 @@ import kotlin.math.floor
class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener {
private var vip: Boolean = false
private var isFirst = false
companion object {
@@ -31,16 +32,26 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener {
}
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
getCurrentRoadTrafficLight(trafficLightResult)?.let {
handleRedLightWarning(it, trafficLightResult.flashYellow)
Logger.d(TAG, "处理路口交通数据。isFirst为${isFirst}")
if (isFirst) {
getCurrentRoadTrafficLight(trafficLightResult)?.let {
handleRedLightWarning(it, trafficLightResult.flashYellow)
}
isFirst = false
}
}
override fun onEnterCrossRoad() {
Logger.d(TAG, "进入路口")
isFirst = true
}
override fun onVipSet(status: Boolean) {
vip = status
}
fun listenTrafficLight() {
CallTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
CallVipSetListenerManager.registerVipSetListener(TAG, this)
}