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
b58105fb
Commit
b58105fb
authored
Apr 14, 2020
by
ydl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手动切换axb之前,如果声网是连接成功状态,调用上传异常接口108,成功之后,才能调用dial接口切换axb,如果未连接成功,则走原逻辑
parent
44c7d0a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
7 deletions
+24
-7
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+15
-6
YDLavManager.kt
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
+9
-1
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
b58105fb
...
...
@@ -181,7 +181,7 @@ class AudioHomeActivity :
override
fun
onWarning
(
warn
:
Int
)
{
super
.
onWarning
(
warn
)
uploadException
(
"mRtcEventHandler-onWarning:warnCode--%${warn}"
)
uploadException
(
"mRtcEventHandler-onWarning:warnCode--%${warn}"
,
callback
=
null
)
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
//105:查找频道请求被服务器拒绝。服务器可能没有办法处理这个请求或请求是非法的
...
...
@@ -203,7 +203,7 @@ class AudioHomeActivity :
override
fun
onError
(
err
:
Int
)
{
super
.
onError
(
err
)
uploadException
(
"mRtcEventHandler-onError:errorCode--%${err}"
)
uploadException
(
"mRtcEventHandler-onError:errorCode--%${err}"
,
callback
=
null
)
uploadLog
()
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
...
...
@@ -700,7 +700,16 @@ class AudioHomeActivity :
* 切换成axb路线请求
*/
private
fun
switchAXB
()
{
mPresenter
.
getAXBPhone
(
ConnectCommand
(
listenId
!!
,
"1"
))
if
(
isConnectSuccess
)
{
uploadException
(
""
,
"zhu"
,
"108"
,
object
:
YDLavManager
.
UploadExceptionCallback
{
override
fun
onSuccess
()
{
mPresenter
.
getAXBPhone
(
ConnectCommand
(
listenId
!!
,
"1"
))
}
})
}
else
{
mPresenter
.
getAXBPhone
(
ConnectCommand
(
listenId
!!
,
"1"
))
}
}
/**
...
...
@@ -1082,12 +1091,12 @@ class AudioHomeActivity :
* 上传错误日志
* zhu 洪平要的,判别是移动端主动调的还是声网返的
*/
private
fun
uploadException
(
message
:
String
,
zhu
:
String
=
""
,
eventType
:
String
=
"99"
)
{
private
fun
uploadException
(
message
:
String
,
zhu
:
String
=
""
,
eventType
:
String
=
"99"
,
callback
:
YDLavManager
.
UploadExceptionCallback
?
)
{
var
time
:
String
=
(
System
.
currentTimeMillis
()
/
1000
).
toString
()
var
uid
:
String
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
?.
uid
!!
var
payLoad
=
PayLoad
(
channelId
?:
"0"
,
time
,
uid
,
"1"
,
"999"
,
message
)
var
connectException
=
ConnectExceptionCommand
(
time
+
zhu
,
"2"
,
eventType
,
payLoad
)
YDLavManager
.
instances
.
uploadException
(
connectException
)
YDLavManager
.
instances
.
uploadException
(
connectException
,
callback
)
}
...
...
@@ -1106,7 +1115,7 @@ class AudioHomeActivity :
override
fun
onDestroy
()
{
super
.
onDestroy
()
if
(
isConnectSuccess
)
{
uploadException
(
""
,
"zhu"
,
"108"
)
uploadException
(
""
,
"zhu"
,
"108"
,
callback
=
null
)
}
if
(
handler
!=
null
)
{
handler
=
null
...
...
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
View file @
b58105fb
...
...
@@ -317,18 +317,26 @@ class YDLavManager {
* 声网出现异常,上传错误日志 connectException
*/
@SuppressLint
(
"CheckResult"
)
fun
uploadException
(
connectException
:
ConnectExceptionCommand
)
{
fun
uploadException
(
connectException
:
ConnectExceptionCommand
,
callback
:
UploadExceptionCallback
?
)
{
AudioApiRequestUtil
.
connectException
(
connectException
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
callback
?.
onSuccess
()
},
{
LogUtil
.
e
(
"agora"
,
"声网上传异常与错误日志接口调用失败:"
+
it
.
message
)
})
}
/**
* 上传异常错误回调
*/
interface
UploadExceptionCallback
{
fun
onSuccess
()
}
/**
* 实时消息全局监听
*/
private
val
listener
=
object
:
InitListener
{
...
...
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