Go to file
2021-12-28 11:13:14 +08:00
src 完善说明文档 2021-12-27 11:25:27 +08:00
www 完善说明文档 2021-12-27 11:25:27 +08:00
.gitignore Initial commit 2021-12-21 16:17:40 +08:00
LICENSE Initial commit 2021-12-21 16:17:40 +08:00
package.json init 2021-12-21 16:35:16 +08:00
plugin.xml 调整文件结构 2021-12-26 20:05:24 +08:00
README.md 更新 'README.md' 2021-12-28 11:13:14 +08:00

cordova-plugin-trtc

腾讯实时音视频(TRTC)封装cordova插件

使用方法

cordova plugin add git+http://m.shuto.cn:8680/public/cordova-plugin-trtc.git

内置方法

加入视频会议

cordova.plugin.trtc.joinChannel(
        {
          ROOM_ID: 123123, // 房间号
          USER_ID: '', // 用户id
          SDK_APP_ID: '', // TRTC app id 
          USER_SIG: '' // 用户签名
        },
        res => { console.log(res); },
        err => { console.log(err); },
      );

用户信息变更

cordova.plugin.trtc.userInfoChange(
        {
          room: 123123, // 房间号
          userId: '', // 用户id
          displayName: '', // 用户名
        },
        res => { console.log(res); },
        err => { console.log(err); },
      );

主播窗口变更事件

document.addEventListener(
      cordova.plugin.trtc.Constant.EVENT_ON_LAYOUT_CHANGE,
      (event: {room:string,userId:string}) => {
      },
      false
    );

用户加入房间事件

document.addEventListener(
      cordova.plugin.trtc.Constant.EVENT_ON_USER_VIDEO_AVAILABLE,
      (event: {room:string,userId:string,available:boolean}) => {
      },
      false
    );