diff --git a/labs/html5-embed/public/index.html b/labs/html5-embed/public/index.html index 3acf0f5e5150ec7d46da795db766b8cf813548b3..7af2fd36526913dd368be0ce2e5497b61b311d0c 100755 --- a/labs/html5-embed/public/index.html +++ b/labs/html5-embed/public/index.html @@ -11,8 +11,8 @@ <link rel="stylesheet" type="text/css" href="css/font-awesome.css"> <link rel="stylesheet" type="text/css" href="css/layout.css"> - <script type="text/javascript" src="http://192.168.0.249/client/swfobject/swfobject.js"></script> - <script type="text/javascript"> + <script type="text/javascript" src="http://192.168.0.249/client/swfobject/swfobject.js"></script> + <script type="text/javascript"> swfobject.registerObject("BigBlueButton", "11", "expressInstall.swf"); </script> <script src="js/lib/jquery-1.7.2.min.js"></script> @@ -21,7 +21,7 @@ <script src="http://192.168.0.249/client/lib/bbb_blinker.js" language="javascript"></script> <script src="http://192.168.0.249/client/lib/bbb_deskshare.js" language="javascript"></script> <script type="text/javascript" src="http://192.168.0.249/client/lib/bbb_api_bridge.js"></script> - <script type="text/javascript" src="http://192.168.0.235/3rd-party.js"></script> + <script type="text/javascript" src="http://192.168.0.235/html5-embed/public/js/lib/3rd-party.js"></script> <script> window.displayBBBClient = function() { var bbbc = document.getElementById("content"); diff --git a/labs/html5-embed/public/js/collections/users.js b/labs/html5-embed/public/js/collections/users.js index 00a2851bf29e680f481ab6aa249998e3d26f8ad9..9ef22404e3b0973d787bfc719aa14ece76285197 100755 --- a/labs/html5-embed/public/js/collections/users.js +++ b/labs/html5-embed/public/js/collections/users.js @@ -7,10 +7,18 @@ define([ var UserCollection = Backbone.Collection.extend({ model: UserModel, initialize: function(){ - + var self = this; + 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."); + self.add({ userid: bbbEvent.userID, username: bbbEvent.userName}); + }); } - }); - - return UserCollection; + + var userCollection = new UserCollection(); + + return userCollection; }); diff --git a/labs/html5-embed/public/js/lib/3rd-party.js b/labs/html5-embed/public/js/lib/3rd-party.js new file mode 100755 index 0000000000000000000000000000000000000000..390c82a5c1fce90ca86080da553d51a41ece8c8c --- /dev/null +++ b/labs/html5-embed/public/js/lib/3rd-party.js @@ -0,0 +1,60 @@ + +var registerListeners = function() { + BBB.listen("UserJoinedVoiceEvent", 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(); +} + +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); + }); +} + +var muteMe = function() { + BBB.muteMe(); +} + +var unmuteMe = function() { + BBB.unmuteMe(); +} + +var muteAll = function() { + BBB.muteAll(); +} + +var unmuteAll = function() { + BBB.unmuteAll(); +} + +var switchLayout = function(newLayout) { + BBB.switchLayout(newLayout); +} + +var sendPublicChat = function () { + var message = "Hello from the Javascript API"; + BBB.sendPublicChatMessage('0x7A7A7A', "en", message); +} + +var sendPrivateChat = function () { + var message = "ECHO: " + bbbEvent.message; + BBB.sendPrivateChatMessage(bbbEvent.fromColor, bbbEvent.fromLang, message, bbbEvent.fromUserID); +} diff --git a/labs/html5-embed/public/js/router.js b/labs/html5-embed/public/js/router.js index 1d80b80e3e058d25bb8293f238e722420ba49e78..924d14b31d1cdcd3061e84bc72bc366fa8e56f28 100755 --- a/labs/html5-embed/public/js/router.js +++ b/labs/html5-embed/public/js/router.js @@ -13,12 +13,17 @@ define([ var initialize = function(){ var app_router = new AppRouter; app_router.on('route:defaultAction', function (actions) { - require(['views/users/list'], function(UserListView) { - console.log("Opening main view"); + require(['views/users/list'], function(UsersView) { + console.log("Opening users view"); // We have no matching route, lets display the home page - var usersView = new UserListView(); - usersView.render(); + // var usersView = UsersView; + // UsersView.render(); }); +// require(['views/flash/client'], function(FlashClientView) { +// console.log("Opening main view"); +// var flashClientView = new FlashClientView(); +// flashClientView.render(); +// }); }); Backbone.history.start(); }; diff --git a/labs/html5-embed/public/js/views/flash/client.js b/labs/html5-embed/public/js/views/flash/client.js new file mode 100755 index 0000000000000000000000000000000000000000..9a8e3baae0b138e6af5db822938cccd1c48f478f --- /dev/null +++ b/labs/html5-embed/public/js/views/flash/client.js @@ -0,0 +1,15 @@ +define([ + 'jquery', + 'underscore', + 'backbone', + 'text!templates/flash/client.html' +], function($, _, Backbone, flashClientTemplate){ + + var FlashClientView = Backbone.View.extend({ + el: $("#content"), + render: function(){ + this.$el.html(flashClientTemplate); + } + }); + return FlashClientView; +}); \ No newline at end of file diff --git a/labs/html5-embed/public/js/views/users/list.js b/labs/html5-embed/public/js/views/users/list.js index ca4791c127e2905473e9185299ffc44cf6098a97..5a163917a6f91dbbe214165f01e86fadea614535 100755 --- a/labs/html5-embed/public/js/views/users/list.js +++ b/labs/html5-embed/public/js/views/users/list.js @@ -6,25 +6,33 @@ define([ 'collections/users', 'text!templates/users/list.html' ], function($, _, Backbone, UserCollection, userListTemplate){ - var UserListView = Backbone.View.extend({ + + + + var UsersView = Backbone.View.extend({ el: $("#users"), - initialize: function(){ - this.collection = new UserCollection(); - // this.collection.bind("add", this.exampleBind); - this.collection = this.collection.add({ userid: "u1", username: "Richard"}); - this.collection = this.collection.add({ userid: "u2", username: "Jesus"}); - this.collection = this.collection.add({ userid: "u3", username: "Fred"}); + initialize: function(){ + // UserCollection.add({ userid: "u1", username: "Richard"}); + // UserCollection.add({ userid: "u2", username: "Jesus"}); + // UserCollection.add({ userid: "u3", username: "Fred"}); }, exampleBind: function( model ){ - console.log("Example Bind [" + model.username + "]"); + console.log("Example Bind [" + model.get("userid") + ", " + model.get("username") + "]"); + this.render(); }, render: function(){ + console.log("*** Rendering Users View [" + UserCollection.length + "]"); var data = { - users: this.collection.models + users: UserCollection.models }; var compiledTemplate = _.template( userListTemplate, data ); this.$el.html( compiledTemplate ); } }); - return UserListView; + + var usersView = new UsersView(); + + UserCollection.on("add", usersView.render); + + return usersView; }); diff --git a/labs/html5-embed/public/templates/flash/client.html b/labs/html5-embed/public/templates/flash/client.html new file mode 100755 index 0000000000000000000000000000000000000000..17f63dd9cfac6942ec0363743e68037d064416ea --- /dev/null +++ b/labs/html5-embed/public/templates/flash/client.html @@ -0,0 +1,20 @@ + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" 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" /> + <param name="bgcolor" value="#869ca7" /> + <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="100%" height="90%" align="middle"> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="always" /> + <!--<![endif]--> + <a href="http://www.adobe.com/go/getflashplayer"> + <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> + </a> + <!--[if !IE]>--> + </object> + <!--<![endif]--> + </object> \ No newline at end of file