Commit 2fb167a1 by YKai

feat: 修复倾诉挂断延迟执行问题

parent cebfc34e
...@@ -673,12 +673,12 @@ class AudioHomeActivity : ...@@ -673,12 +673,12 @@ class AudioHomeActivity :
tv_name.text = expertName tv_name.text = expertName
// tv_tips.text = expertTips // tv_tips.text = expertTips
var time = totalDuration?.minus(remainTime!!.toInt()) val time = totalDuration?.minus(remainTime!!.toInt())
tv_remain_time.text = DateUtils.formatTime((time).toString()) tv_remain_time.text = DateUtils.formatTime((time).toString())
val timeTotal= totalDuration?.div(60); val timeTotal= totalDuration?.div(60);
tv_totalDuration.text="(满${timeTotal}分钟自动挂断,限24小时内拨打)" tv_totalDuration.text="(满${timeTotal}分钟自动挂断,限24小时内拨打)"
if (!TextUtils.isEmpty(expertHeadUrl)) { if (!TextUtils.isEmpty(expertHeadUrl)) {
var option = SimpleImageOpConfiger() val option = SimpleImageOpConfiger()
option.errorPic = R.drawable.audioim_head_place_hold_pic option.errorPic = R.drawable.audioim_head_place_hold_pic
option.loadingPic = R.drawable.audioim_head_place_hold_pic option.loadingPic = R.drawable.audioim_head_place_hold_pic
option.transform = 0 option.transform = 0
...@@ -1425,7 +1425,7 @@ class AudioHomeActivity : ...@@ -1425,7 +1425,7 @@ class AudioHomeActivity :
null, null,
channelId channelId
) )
var cmd = NoticePushCommand() val cmd = NoticePushCommand()
cmd.data = msgBean cmd.data = msgBean
cmd.pushId = listenerUid cmd.pushId = listenerUid
if (isCall) { if (isCall) {
...@@ -1452,6 +1452,8 @@ class AudioHomeActivity : ...@@ -1452,6 +1452,8 @@ class AudioHomeActivity :
LogUtil.e("播放结束音频") LogUtil.e("播放结束音频")
//播放结束音频 //播放结束音频
playFinishMusic() playFinishMusic()
// 声网离开房间
voiceManage?.getVoiceApi()?.leaveChannel()
} }
} }
...@@ -1577,11 +1579,11 @@ class AudioHomeActivity : ...@@ -1577,11 +1579,11 @@ class AudioHomeActivity :
eventType: String = "99", eventType: String = "99",
callback: YDLavManager.UploadExceptionCallback? callback: YDLavManager.UploadExceptionCallback?
) { ) {
var time: String = (System.currentTimeMillis() / 1000).toString() val time: String = (System.currentTimeMillis() / 1000).toString()
var uid: String = val uid: String =
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!! ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!!
var payLoad = PayLoad(channelId ?: "0", time, uid, "1", "999", message) val payLoad = PayLoad(channelId ?: "0", time, uid, "1", "999", message)
var connectException = val connectException =
ConnectExceptionCommand(time + zhu, "2", eventType, payLoad, callStatus) ConnectExceptionCommand(time + zhu, "2", eventType, payLoad, callStatus)
YDLavManager.instances.uploadException(connectException, callback) YDLavManager.instances.uploadException(connectException, callback)
} }
...@@ -1598,7 +1600,7 @@ class AudioHomeActivity : ...@@ -1598,7 +1600,7 @@ class AudioHomeActivity :
} }
override fun finishActivity() { override fun finishActivity() {
leaveChannel() // leaveChannel()
} }
override fun onDestroy() { override fun onDestroy() {
...@@ -1640,7 +1642,10 @@ class AudioHomeActivity : ...@@ -1640,7 +1642,10 @@ class AudioHomeActivity :
localPowerManager = null localPowerManager = null
if (null != voiceManage && null != voiceManage?.getVoiceApi()) { if (null != voiceManage && null != voiceManage?.getVoiceApi()) {
voiceManage?.getVoiceApi()?.leaveChannel() if (!isLeavelChannel) {
// 声网离开房间
voiceManage?.getVoiceApi()?.leaveChannel()
}
voiceManage?.getVoiceApi()?.destroy() voiceManage?.getVoiceApi()?.destroy()
voiceManage = null voiceManage = null
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment