bigbluebutton-Github/bigbluebutton-client/resources/prod/lib/3rd-party.js

113 lines
3.0 KiB
JavaScript
Raw Normal View History

2012-10-25 05:27:44 +08:00
2012-10-25 03:28:24 +08:00
var registerListeners = function() {
console.log("Listening for events.");
2012-10-25 03:28:24 +08:00
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.");
});
BBB.listen("NewPublicChatEvent", function(bbbEvent) {
console.log("Received NewPublicChatEvent [" + bbbEvent.message + "]");
});
BBB.listen("NewPrivateChatEvent", function(bbbEvent) {
console.log("Received NewPrivateChatEvent event");
});
BBB.listen("UserJoinedVoiceEvent", function(bbbEvent) {
console.log("User [" + bbbEvent.userID + "] had joined the voice conference.");
});
BBB.listen("UserLeftVoiceEvent", function(bbbEvent) {
console.log("User [" + bbbEvent.userID + "has left the voice conference.");
});
BBB.listen("UserVoiceMutedEvent", function(bbbEvent) {
console.log("User [" + bbbEvent.userID + "] is muted [" + bbbEvent.muted + "]");
});
BBB.listen("UserLockedVoiceEvent", function(bbbEvent) {
console.log("User [" + bbbEvent.userID + "] is locked [" + bbbEvent.locked + "]");
});
2012-10-25 03:28:24 +08:00
}
var leaveVoiceConference2 = function () {
BBB.leaveVoiceConference();
}
2012-10-25 03:28:24 +08:00
var joinVoiceConference2 = function () {
BBB.joinVoiceConference();
}
var amIPresenterAsync = function() {
BBB.listen("AmIPresenterQueryResponse", function(bbbEvent) {
console.log("Received AmIPresenterQueryResponse event [" + bbbEvent.amIPresenter + "]");
});
BBB.amIPresenter();
}
var amIPresenterSync = function() {
BBB.amIPresenter(function(amIPresenter) {
console.log("Am I Presenter = " + amIPresenter);
});
}
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 05:24:10 +08:00
2012-11-21 04:20:12 +08:00
var getMyUserID = function() {
BBB.getMyUserID(function(userID) {
console.log("My user ID = [" + userID + "]");
});
}
2012-11-21 03:27:23 +08:00
var getMeetingID = function() {
BBB.getMeetingID(function(meetingID) {
console.log("Meeting ID = [" + meetingID + "]");
});
}
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);
}
var lockLayout = function(lock) {
BBB.lockLayout(lock);
}
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-25 03:28:24 +08:00
var sendPrivateChat = function () {
var message = "ECHO: " + bbbEvent.message;
BBB.sendPrivateChatMessage(bbbEvent.fromColor, bbbEvent.fromLang, message, bbbEvent.fromUserID);
}