Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
c244aecc
Commit
c244aecc
authored
Oct 13, 2020
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:声网onRtcStat回调,退出房间逻辑去掉,增加日志上传
parent
b9e2abb3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+31
-7
ConsultantAudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
+0
-0
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
c244aecc
...
...
@@ -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
)
{
...
...
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
View file @
c244aecc
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment