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
41bc719d
Commit
41bc719d
authored
Aug 26, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yx2.0
parent
c8869ad9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
NimUICallInit.java
m-im/src/main/java/com/yidianling/im/helper/NimUICallInit.java
+14
-5
No files found.
m-im/src/main/java/com/yidianling/im/helper/NimUICallInit.java
View file @
41bc719d
...
...
@@ -2,18 +2,20 @@ package com.yidianling.im.helper;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.os.Looper
;
import
android.text.TextUtils
;
import
com.netease.lava.nertc.sdk.NERtcConstants
;
import
com.netease.lava.nertc.sdk.NERtcEx
;
import
com.netease.lava.nertc.sdk.NERtcOption
;
import
com.netease.lava.nertc.sdk.video.NERtcEncodeConfig
;
import
com.netease.lava.nertc.sdk.video.NERtcVideoConfig
;
import
com.netease.nimlib.sdk.RequestCallback
;
import
com.netease.yunxin.nertc.nertcvideocall.bean.InvitedInfo
;
import
com.netease.yunxin.nertc.nertcvideocall.model.NERtcCallExtension
;
import
com.netease.yunxin.nertc.ui.CallKitNotificationConfig
;
import
com.netease.yunxin.nertc.ui.CallKitUI
;
import
com.netease.yunxin.nertc.ui.CallKitUIOptions
;
import
com.netease.yunxin.nertc.ui.extension.SelfConfigExtension
;
import
com.netease.yunxin.nertc.ui.service.DefaultIncomingCallEx
;
import
com.ydl.ydlcommon.modular.ModularServiceManagerKt
;
import
com.ydl.ydlcommon.utils.log.XLog
;
...
...
@@ -42,7 +44,9 @@ public class NimUICallInit {
UserResponseBean
.
UserInfo
userInfo
=
ModularServiceManagerKt
.
findRouteService
(
IUserService
.
class
).
getUserInfo
();
if
(
userInfo
==
null
)
return
;
String
userId
=
userInfo
.
getUid
();
android
.
util
.
Log
.
e
(
"qwert"
,
userId
);
//防止网络波动的情况下多次触发LOGINED状态,导致呼叫组件重新初始化
if
(
TextUtils
.
equals
(
userId
,
CallKitUI
.
INSTANCE
.
getCurrentUserAccId
()))
return
;
android
.
util
.
Log
.
e
(
"qwert"
,
userId
+
(
Looper
.
myLooper
()
==
Looper
.
getMainLooper
()));
String
appKey
=
NimApplication
.
getInstance
().
getAppKey
();
CallKitUIOptions
options
=
new
CallKitUIOptions
.
Builder
()
// 必要:音视频通话 sdk appKey,用于通话中使用
...
...
@@ -53,15 +57,20 @@ public class NimUICallInit {
.
currentUserRtcUId
(
Long
.
parseLong
(
userId
))
// 通话接听成功的超时时间单位 毫秒,默认30s
.
timeOutMillisecond
(
30
*
1000L
)
.
rtcCallExtension
(
new
SelfConfig
Extension
(){
.
rtcCallExtension
(
new
NERtcCall
Extension
(){
@Override
p
ublic
void
configVideoConfig
(
)
{
p
rotected
int
joinChannel
(
String
token
,
String
channelName
,
long
rtcUid
)
{
NERtcVideoConfig
videoConfig
=
new
NERtcVideoConfig
();
videoConfig
.
frameRate
=
NERtcEncodeConfig
.
NERtcVideoFrameRate
.
FRAME_RATE_FPS_15
;
videoConfig
.
bitrate
=
600
;
videoConfig
.
width
=
640
;
videoConfig
.
height
=
480
;
videoConfig
.
degradationPrefer
=
NERtcVideoConfig
.
NERtcDegradationPreference
.
DEGRADATION_MAINTAIN_FRAMERATE
;
NERtcEx
.
getInstance
().
setLocalVideoConfig
(
videoConfig
);
// 音频设置 standard + speech
NERtcEx
.
getInstance
().
setAudioProfile
(
NERtcConstants
.
AudioProfile
.
STANDARD
,
NERtcConstants
.
AudioScenario
.
SPEECH
);
// 设置 channel profile
NERtcEx
.
getInstance
().
setChannelProfile
(
NERtcConstants
.
RTCChannelProfile
.
COMMUNICATION
);
return
NERtcEx
.
getInstance
().
joinChannel
(
token
,
channelName
,
rtcUid
);
}
})
// 此处为 收到来电时展示的 notification 相关配置,如图标,提示语等。
...
...
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