Skip to content
Snippets Groups Projects
Commit 97cb4429 authored by Richard Alam's avatar Richard Alam
Browse files

Merge branch 'send-receive-chat-from-js-api' of...

Merge branch 'send-receive-chat-from-js-api' of github.com:bigbluebutton/bigbluebutton into send-receive-chat-from-js-api
parents 3cce928e 3879cc44
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,9 @@
var bbbc = document.getElementById("content");
bbbc.style.display = "block";
}
window.onload = function() {
registerListeners();
}
</script>
</head>
<body>
......@@ -39,11 +42,11 @@
<button type="button" onclick="unmuteAll()">Unmute All</button>
<button type="button" onclick="switchLayout('Video Chat')">Switch Video Layout</button>
<button type="button" onclick="switchLayout('Default')">Switch Default Layout</button>
<button type="button" onclick="echoPublicChat()">Echo Public Chat</button>
<button type="button" onclick="echoPrivateChat()">Echo Private Chat</button>
<button type="button" onclick="sendPublicChat()">Send Public Chat</button>
<button type="button" onclick="sendPrivateChat()">Send Private Chat</button>
</div>
<div id="content" style="display: none">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="80%" height="80%" id="BigBlueButton" name="BigBlueButton" align="middle">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="90%" id="BigBlueButton" name="BigBlueButton" align="middle">
<param name="movie" value="http://192.168.0.249/client/BigBlueButton.swf?v=VERSION" />
<param name="quality" value="high" />
<param name="allowfullscreen" value="true" />
......@@ -51,7 +54,7 @@
<param name="wmode" value="window" />
<param name="allowScriptAccess" value="always" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="http://192.168.0.249/client/BigBlueButton.swf?v=VERSION" width="80%" height="80%" align="middle">
<object type="application/x-shockwave-flash" data="http://192.168.0.249/client/BigBlueButton.swf?v=VERSION" width="100%" height="90%" align="middle">
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="always" />
......
var joinVoiceConference2 = function () {
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.");
});
BBB.listen("userHasJoinedVoiceConference", function(bbbEvent) {
console.log("Received userHasJoinedVoiceConference event");
});
BBB.listen("NewPublicChatEvent", function(bbbEvent) {
console.log("Received NewPublicChatEvent [" + bbbEvent.message + "]");
});
BBB.listen("NewPrivateChatEvent", function(bbbEvent) {
console.log("Received NewPrivateChatEvent event");
});
}
var joinVoiceConference2 = function () {
BBB.joinVoiceConference();
}
......@@ -39,18 +54,12 @@ var switchLayout = function(newLayout) {
BBB.switchLayout(newLayout);
}
var echoPublicChat = function () {
BBB.listen("NewPublicChatEvent", function(bbbEvent) {
console.log("Received NewPublicChatEvent event");
var message = "ECHO: " + bbbEvent.message;
BBB.sendPublicChatMessage(bbbEvent.fromUserID, bbbEvent.fromColor, bbbEvent.fromLang, message);
});
var sendPublicChat = function () {
var message = "Hello from the Javascript API";
BBB.sendPublicChatMessage('0x7A7A7A', "en", message);
}
var echoPrivateChat = function () {
BBB.listen("NewPrivateChatEvent", function(bbbEvent) {
console.log("Received NewPrivateChatEvent event");
var message = "ECHO: " + bbbEvent.message;
BBB.sendPrivateChatMessage(bbbEvent.toUserID, bbbEvent.fromColor, bbbEvent.fromLang, message, bbbEvent.fromUserID);
});
var sendPrivateChat = function () {
var message = "ECHO: " + bbbEvent.message;
BBB.sendPrivateChatMessage(bbbEvent.fromColor, bbbEvent.fromLang, message, bbbEvent.fromUserID);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment