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();
