|
||
---|---|---|
src | ||
www | ||
.gitignore | ||
LICENSE | ||
package.json | ||
plugin.xml | ||
README.md |
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
);