@pano.video/panortc-electron-sdk

1.3.8 • Public • Published

PanoRtc-Electron-SDK

Installing

npm install @pano.video/panortc-electron-sdk

RtcEngine 连接步骤

连接步骤可以参考 sample     VUE sample

RtcEngine 接口文档

连接步骤:

  1. 获取PanoRtc接口类: const {RtcEngine} = require('@pano.video/panortc-electron-sdk')
  2. 创建PanoRtc接口对象: var rtcEngine = new RtcEngine();
  3. 获取 PanoToken
  4. 调用 rtcEngine.initialize , 初始化 PanoRtcEngine
  5. 调用 rtcEngine.joinChannel , 使用第二步获取的 panoToken 和会议 channelId 等参数加入会议,可以设置 serviceFlags 类型控制只加入音视频频道、白板频道或者二者都加入
  6. 监听到 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'
})

Readme

Keywords

Package Sidebar

Install

npm i @pano.video/panortc-electron-sdk

Weekly Downloads

4

Version

1.3.8

License

ISC

Unpacked Size

4.53 kB

Total Files

3

Last publish

Collaborators

  • villeewang
  • leopano
  • folkib
  • yomark