bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/bbb/index.js
2017-07-24 11:15:46 -03:00

48 lines
1.1 KiB
JavaScript
Executable File

import AudioManager from '/imports/api/2.0/audio/client/manager';
import Auth from '/imports/ui/services/auth';
import Users from '/imports/api/2.0/users';
import Meetings from '/imports/api/2.0/meetings';
class BBB {
getUserId() {
const userID = Auth.userID;
return userID;
}
getUsername() {
return Users.findOne({ userId: this.getUserId() }).user.name;
}
getExtension() {
const extension = Meetings.findOne().voiceConf;
return extension;
}
getMyUserInfo(callback) {
const result = {
myUserID: this.getUserId(),
myUsername: this.getUsername(),
myInternalUserID: this.getUserId(),
myAvatarURL: null,
myRole: 'getMyRole',
amIPresenter: 'false',
voiceBridge: this.getExtension(),
dialNumber: null,
};
return callback(result);
}
webRTCCallFailed(inEchoTest, errorcode, cause) {
AudioManager.webRTCCallFailed(inEchoTest, errorcode, cause);
}
webRTCCallStarted(inEchoTest) {
AudioManager.webRTCCallStarted(inEchoTest);
}
}
if (window.BBB == undefined) {
window.BBB = new BBB();
}