cordova-plugin-trtc/www/trtc.js
2021-12-27 11:25:27 +08:00

24 lines
606 B
JavaScript

var exec = require('cordova/exec');
function Trtc() {}
Trtc.prototype.joinChannel = function(arg, success, error) {
exec(success, error, 'Trtc', 'joinChannel', [arg]);
};
Trtc.prototype.userInfoChange = function(userInfo,success, error) {
exec(success, error, 'Trtc', 'userInfoChange', [userInfo]);
};
Trtc.prototype.fireEvent = function(event,extra) {
cordova.fireDocumentEvent("trtc."+event, extra);
};
Trtc.prototype.Constant = {
EVENT_ON_LAYOUT_CHANGE :'trtc.onLayoutChangeMessage',
EVENT_ON_USER_VIDEO_AVAILABLE :'trtc.onUserVideoAvailable',
};
module.exports = new Trtc();