2012-10-25 03:28:24 +08:00
|
|
|
var registerListeners = function() {
|
|
|
|
BBB.listen("UserLeftEvent", function(bbbEvent) {
|
|
|
|
console.log("User [" + bbbEvent.userID + "] has left.");
|
|
|
|
});
|
|
|
|
BBB.listen("UserJoinedEvent", function(bbbEvent) {
|
|
|
|
console.log("User [" + bbbEvent.userID + ", [" + bbbEvent.userName + "] has joined.");
|
|
|
|
});
|
2012-10-05 03:46:23 +08:00
|
|
|
BBB.listen("userHasJoinedVoiceConference", function(bbbEvent) {
|
|
|
|
console.log("Received userHasJoinedVoiceConference event");
|
|
|
|
});
|
2012-10-25 03:28:24 +08:00
|
|
|
BBB.listen("NewPublicChatEvent", function(bbbEvent) {
|
|
|
|
console.log("Received NewPublicChatEvent [" + bbbEvent.message + "]");
|
|
|
|
});
|
|
|
|
BBB.listen("NewPrivateChatEvent", function(bbbEvent) {
|
|
|
|
console.log("Received NewPrivateChatEvent event");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
var joinVoiceConference2 = function () {
|
2012-10-05 03:46:23 +08:00
|
|
|
BBB.joinVoiceConference();
|
|
|
|
}
|
|
|
|
|
2012-10-05 05:24:10 +08:00
|
|
|
var getMyRoleAsynch = function() {
|
|
|
|
BBB.listen("GetMyRoleResponse", function(bbbEvent) {
|
|
|
|
console.log("Received GetMyRoleResponse event");
|
|
|
|
});
|
|
|
|
|
|
|
|
BBB.getMyRole();
|
|
|
|
}
|
|
|
|
|
|
|
|
var getMyRoleSynch = function() {
|
|
|
|
BBB.getMyRole(function(myRole) {
|
|
|
|
console.log("My role = " + myRole);
|
|
|
|
});
|
2012-10-05 03:46:23 +08:00
|
|
|
}
|
2012-10-05 05:24:10 +08:00
|
|
|
|
2012-10-06 04:54:45 +08:00
|
|
|
var muteMe = function() {
|
|
|
|
BBB.muteMe();
|
|
|
|
}
|
|
|
|
|
|
|
|
var unmuteMe = function() {
|
|
|
|
BBB.unmuteMe();
|
|
|
|
}
|
2012-10-06 05:07:22 +08:00
|
|
|
|
|
|
|
var muteAll = function() {
|
|
|
|
BBB.muteAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
var unmuteAll = function() {
|
|
|
|
BBB.unmuteAll();
|
2012-10-18 22:17:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var switchLayout = function(newLayout) {
|
|
|
|
BBB.switchLayout(newLayout);
|
|
|
|
}
|
|
|
|
|
2012-10-25 03:28:24 +08:00
|
|
|
var sendPublicChat = function () {
|
|
|
|
var message = "Hello from the Javascript API";
|
|
|
|
BBB.sendPublicChatMessage('0x7A7A7A', "en", message);
|
2012-10-19 04:32:20 +08:00
|
|
|
}
|
|
|
|
|
2012-10-25 03:28:24 +08:00
|
|
|
var sendPrivateChat = function () {
|
|
|
|
var message = "ECHO: " + bbbEvent.message;
|
|
|
|
BBB.sendPrivateChatMessage(bbbEvent.fromColor, bbbEvent.fromLang, message, bbbEvent.fromUserID);
|
2012-10-19 04:32:20 +08:00
|
|
|
}
|