PanoRtc-Electron-SDK
Installing
npm install @pano.video/panortc-electron-sdk
RtcEngine 连接步骤
连接步骤可以参考 sample VUE sample
RtcEngine 接口文档
连接步骤:
- 获取
PanoRtc
接口类: const {RtcEngine} = require('@pano.video/panortc-electron-sdk')
- 创建
PanoRtc
接口对象: var rtcEngine = new RtcEngine();
- 获取 PanoToken
- 调用
rtcEngine.initialize
, 初始化 PanoRtcEngine - 调用
rtcEngine.joinChannel
, 使用第二步获取的 panoToken
和会议 channelId
等参数加入会议,可以设置 serviceFlags 类型控制只加入音视频频道、白板频道或者二者都加入 - 监听到
channelJoinConfirm
事件后即可开始通信
示例代码:
const {
RtcEngine,
QResult,
ChannelMode,
AudioAecType,
kChannelServiceMedia
} = require('@pano.video/panortc-electron-sdk')
var rtcEngine = new RtcEngine();
rtcEngine.on('channelJoinConfirm', (result) => {
console.log(`join channel ${result}`)
})
rtcEngine.initialize(appId, {
panoServer: 'api.pano.video',
videoHwAccel: false,
audioAecType: AudioAecType.Default,
audioScenario: 0
})
rtcEngine.joinChannel(token, channelId, userId, {
channelMode: ChannelMode.Mode_Meeting,
subscribeAudioAll: true,
userName: 'xxxx'
})