bvpronext-sdk-web-mobile
v0.1.11
Published
``` npm i bvpronext-sdk-web-mobile ``` ## 引入 ``` import { initSDK, setCustomerDomain, authSdk, joinMeeting } from 'bvpronext-sdk-web-mobile'; ``` ## 快速使用 注意参数的替换以及调用顺序 ``` initSDK(); setCustomerDomain(domain); await authSdk
Readme
BVProNext-SDK-Web-Mobile
安装
npm i bvpronext-sdk-web-mobile引入
import { initSDK, setCustomerDomain, authSdk, joinMeeting } from 'bvpronext-sdk-web-mobile';快速使用
注意参数的替换以及调用顺序
initSDK();
setCustomerDomain(domain);
await authSdk(channelId, channelKey);
await joinMeeting(dom, username, meetingNumber);接口
1 初始化
initSDK();初始化sdk必须首先调用
2 设置域名
setCustomerDomain(domain, mediaUrl);domain:设置请求地址域名,例如https://xxx.xxx.xxx
mediaUrl:设置媒体请求地址域名,例如https://xxx.xxx.xxx
3 认证
await authSdk(channelId, channelKey);channelId:频道ID
channelKey:频道Key
4 入会
await joinMeeting(dom, username, meetingNumber, password, isForce, cuid, zak, callbackOpt);dom:渲染入会页面的dom
username:会中显示的名称
meetingNumber:会议号码
password:会议密码
isForce:默认是0,1表示强制入会
cuid:入会人的第三方身份
zak:入会人token
callbackOpt:回调选项示例如下
{
cannel: ()=>{ console.log('joinMeeting cannel') }, // 取消加入房间
success: (scene) => { console.log('joinMeeting success', scene) }, // 成功加入房间
error: (error) => { console.log('joinMeeting error', error) }, // 失败加入房间
onExited: (roomId, reason) => { console.log('onExited:', roomId, reason) }, // 离会回调
onLaunchFailure: (roomId, error) => { console.log('onLaunchFailure:', roomId, error) }, // 启会失败回调
}返回错误如下 | 错误码 | 原因 | Reason | |---------|---------|---------| | 102 | 请求鉴权失败 | The request authentication fails. | | 103 | 服务器内部错误 | Server internal error. | | 109 | 请求参数不满足条件 | The request parameter is incorrect. | | 208 | 请注册后加入会议 | Please join the meeting after register. | | 661 | 会议室上有其他正在进行中的会议,请稍后再试 | There is another meeting runnning on the meeting room, please try later. | | 662 | 会议室上有其他正在进行中的会议,是否结束此会议并开启新会议 | There is anothre meeting running on the meeting room. Do you terminate it and start the new meeting? | | 663 | 总并发方数不足 | The call license not enough. | | 664 | 加入会议超时 | Time out to join in meeting, please try later. | | 665 | 请输入会议密码 | Please input the meeting password. | | 666 | 会议密码无效 | The meeting passsword is invalid. | | 707 | 会议已经结束 | Then meeting is already end. |
5 主动离开会议
await leaveMeeting();关于异常
请查看页面console
