5.1.3 • Published 2 years ago
@rongcloud/plugin-call-engine v5.1.3
初始化
// CallLib 内部代码
import { RCCallEngine } from '@rongcloud/call-engine'
const callInstaller = {
tag: 'RCCALL',
verify () {
//...
},
setup(context: PluginContext,) {
const callEngine = new RCCallEngine(
context,
logger, // engine 日志模块
// 收到邀请
onInvite (callId, crtList, inviteList) {
}
)
}
}
CallSession 获取
// rtc 房间 ID
const callId = ''
const { code, session: callSession } = callEngine.createSession(callId, {
onSessionStateChange(state, summary?: any) {
//
},
onUserStateChange(info: {id: string, state: number}[]) {
// 用户不存在于通话中 | 等待接听 | 通话中
},
onRinging(sender) {
// 收到被叫 响铃
},
onMediaModify (sender) {
// 收到媒体类型更改
}
})
CallSession 实例方法
// 单呼
const { code } = await callSession.call(channelId, targetId, mediaType)
// 群呼
const { code } = await callSession.callInGroup(channelId, targetId, mediaType)
// 群呼叫中继续邀请
const { code } = await callSession.invite(['user1', 'user2'])
// 接听
const { code } = await callSession.accept()
// 挂断
const { code } = await callSession.hungup()
// 通话媒体类型修改 (callEngine 层支持 音频转视频 视频转音频 消息,calllib 内部做业务限制)
const { code } = await callSession.changeMediaType(type)
/**
* rtc userJoin 事件触发时调用
* (用于未收到被叫发送的 accept 消息情况下 补偿处理 callSession 内部人员列表及状态)
*/
callSession.userJoin([''])
/**
* rtc userLeft、userKickOff 事件触发时调用
* (用于为收到主叫或被叫发送的 hungup 消息情况下 补偿不理 callSession 内部人员列表及状态)
*/
callSession.userLeave([''])
// session 相关信息获取
callSession.getSessionId()
callSession.getChannelId()
callSession.getTargetId()
callSession.getConversationType()
callSession.getRemoteUsers()
callSession.getSessionState()
callSession.getCallerId()
callSession.getSummary()
5.1.2-enterprise.4
2 years ago
5.1.3
2 years ago
5.1.2
2 years ago
5.1.2-alpha.3
2 years ago
5.1.2-enterprise.1
2 years ago
5.1.2-enterprise.2
2 years ago
5.1.2-enterprise.3
2 years ago
5.0.11-alpha.1
2 years ago
5.1.2-alpha.2
2 years ago
5.1.2-alpha.1
2 years ago
5.0.10
3 years ago
5.0.10-enterprise-alpha.2
3 years ago
5.0.10-enterprise-alpha.1
3 years ago
5.0.9
3 years ago
5.0.7-enterprise.1
3 years ago
5.0.8
3 years ago
5.0.7
3 years ago
5.0.6
3 years ago
5.0.5
4 years ago
5.0.4
4 years ago
5.0.5-alpha.1
4 years ago
5.0.1-alpha.16
4 years ago
5.0.1-alpha.17
4 years ago
5.0.3
4 years ago
5.0.2
4 years ago
5.0.1
4 years ago
5.0.0
4 years ago
5.0.1-alpha.14
4 years ago
5.0.1-alpha.15
4 years ago
5.0.1-alpha.13
4 years ago
5.0.1-alpha.12
4 years ago
5.0.1-alpha.11
4 years ago
5.0.1-alpha.10
4 years ago
5.0.1-alpha.9
4 years ago
5.0.1-alpha.8
4 years ago
5.0.1-alpha.7
4 years ago
5.0.1-alpha.6
4 years ago
5.0.1-alpha.5
4 years ago
5.0.1-alpha.4
4 years ago
5.0.1-alpha.3
4 years ago
5.0.1-alpha.2
4 years ago
5.0.1-alpha.1
4 years ago