@pano.video/panortc-electron-sdk
v1.3.8
Published
panortc-electron-sdk
Downloads
44
Readme
PanoRtc-Electron-SDK
Installing
npm install @pano.video/panortc-electron-sdk
RtcEngine 连接步骤
连接步骤可以参考 sample VUE sample
连接步骤:
- 获取
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, { // engine options, 可不填
panoServer: 'api.pano.video',
videoHwAccel: false,
audioAecType: AudioAecType.Default,
audioScenario: 0
})
rtcEngine.joinChannel(token, channelId, userId, { // channel options, 可不填
channelMode: ChannelMode.Mode_Meeting,
subscribeAudioAll: true, // subscribe user audio automatically
userName: 'xxxx'
})