Commit c244aecc by YKai

feat:声网onRtcStat回调,退出房间逻辑去掉,增加日志上传

parent b9e2abb3
......@@ -79,87 +79,108 @@ class AudioHomeActivity :
* 专家头像地址
*/
private var expertHeadUrl: String? = null
/**
* 专家姓名
*/
private var expertName: String? = null
/**
* 专家文案
*/
private var expertTips: String? = null
/**
* 声网点对点聊天房间id
*/
private var channelId: String? = null
/**
* 通话开始时间(接通)
*/
private var callStartTime: Long? = null
/**
* 倾诉剩余时长(时长单位s,eg:剩余2min15s,返回135)
*/
private var remainTime: String? = null
/**
*聆听者id(不是聆听者的uid)
*/
private var listenId: String? = null
/**
* token
*/
private var token: String? = null
/**
* commentUrl 评价页URL
*/
private var commentUrl: String? = null
/**
* callId
*/
private var callId: String? = null
/**
* relation_id
*/
private var relationId: String? = null
/**
* listenerUid专家uid
*/
private var listenerUid: String? = null
/**
* 倾述总时长
*/
private var totalDuration: Int? = 0
/**
* 本地记录的当前剩余时间
*/
private var localRemainTime: Int? = 0
/**
* 60s自动挂断倒计时
*/
private var waitDisposable: Disposable? = null
/**
* 45s倒计时
*/
private var disposable: Disposable? = null
/**
* 本次倾述倒计时
*/
private var totalDisposable: Disposable? = null
/**
* 是否连接成功
*/
private var isConnectSuccess: Boolean = false
//电源管理对象
private var localPowerManager: PowerManager? = null
//电源锁
private var localWakeLock: PowerManager.WakeLock? = null
private var sensorManager: SensorManager? = null
private var sendDoctocrMsg: String? = null
private var axbPhone: String? = null
//是否跳转到拨号页面
private var isJumpDail: Boolean = false
private var isShowAXB: Boolean = true
private var mPlayer: AudioPlayer? = null
private var vibrator: Vibrator? = null
private var handler: Handler? = null
//声网
private var voiceManage: YDLVoiceManager? = null
......@@ -182,6 +203,7 @@ class AudioHomeActivity :
override fun onWarning(warn: Int) {
super.onWarning(warn)
uploadException("mRtcEventHandler-onWarning:warnCode--%${warn}", callback = null)
writeAgoraLog("通话挂断:网络异常(${warn})")
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
//105:查找频道请求被服务器拒绝。服务器可能没有办法处理这个请求或请求是非法的
......@@ -286,14 +308,16 @@ class AudioHomeActivity :
override fun onRtcStats(stats: IRtcEngineEventHandler.RtcStats?) {
super.onRtcStats(stats)
uploadLog()
// 不需要移动端做离开房间逻辑,服务端会判断进行踢人逻辑
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
if (isConnectSuccess && null != stats?.users && stats.users == 1) {
writeAgoraLog("通话结束:用户加入了频道,但频道内只有一个人")
com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件
uploadLog()
leaveChannel()
}
// if (isConnectSuccess && null != stats?.users && stats.users == 1) {
// writeAgoraLog("通话结束:用户加入了频道,但频道内只有一个人")
// com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
// //通话结束或挂断时,上传日志文件
// uploadLog()
// leaveChannel()
// }
}
override fun onConnectionStateChanged(state: Int, reason: Int) {
......
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