Commit 15c082a4 authored by Dele Olajide's avatar Dele Olajide Committed by dele

Jitsi Videobridge - Refreshed jitmeet application

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13851 b35dd754-fafc-0310-a699-88a17e54d16e
parent c17251c4
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
Jitsi Video Bridge Plugin Changelog Jitsi Video Bridge Plugin Changelog
</h1> </h1>
<p><b>1.1</b> -- Dec 4th, 2013</p> <p><b>1.1</b> -- Jan 4th, 2014</p>
<ul> <ul>
<li>OF-716 Added to Openfire plugins with jitmeet web video conference application</li> <li>OF-716 Added to Openfire plugins with jitmeet web video conference application</li>
......
This diff is collapsed.
...@@ -7,3 +7,10 @@ var config = { ...@@ -7,3 +7,10 @@ var config = {
useNicks: false, useNicks: false,
bosh: '/http-bind/' // FIXME: use xep-0156 for that bosh: '/http-bind/' // FIXME: use xep-0156 for that
}; };
function urlParam(name)
{
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (!results) { return undefined; }
return results[1] || undefined;
}
\ No newline at end of file
...@@ -7,7 +7,6 @@ html, body{ ...@@ -7,7 +7,6 @@ html, body{
background: #e9e9e9; background: #e9e9e9;
} }
#videospace { #videospace {
display: block; display: block;
position: absolute; position: absolute;
......
.jqistates { .jqistates {
font-size: 14px; font-size: 14px;
} }
.jqistates h2 { .jqistates h2 {
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
...@@ -9,18 +9,18 @@ ...@@ -9,18 +9,18 @@
line-height: 25px; line-height: 25px;
text-align: center; text-align: center;
color: #424242; color: #424242;
} }
.jqistates input { .jqistates input {
width: 100%; width: 100%;
margin: 20px 0; margin: 20px 0;
} }
.jqibuttons button { .jqibuttons button {
margin-right: 5px; margin-right: 5px;
float:right; float:right;
} }
button.jqidefaultbutton #inviteLinkRef { button.jqidefaultbutton #inviteLinkRef {
color: #2c8ad2; color: #2c8ad2;
} }
\ No newline at end of file \ No newline at end of file
Strophe.addConnectionPlugin('logger', {
// logs raw stanzas and makes them available for download as JSON
connection: null,
log: [],
init: function (conn) {
this.connection = conn;
this.connection.rawInput = this.log_incoming.bind(this);;
this.connection.rawOutput = this.log_outgoing.bind(this);;
},
log_incoming: function (stanza) {
this.log.push([new Date().getTime(), 'incoming', stanza]);
},
log_outgoing: function (stanza) {
this.log.push([new Date().getTime(), 'outgoing', stanza]);
},
// <a onclick="connection.logger.dump(event.target);">my download button</a>
dump: function (what, filename){
what.download = filename || 'xmpplog.json';
what.href = 'data:application/json;charset=utf-8,\n';
what.href += encodeURIComponent(JSON.stringify(this.log, null, ' '));
return true;
}
});
<html> <html>
<head> <head>
<title>JitMeet</title> <title>WebRTC, meet the Jitsi Videobridge</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script src="jquery.min.js"></script>
<script src="libs/strophejingle.bundle.js"></script><!-- strophe.jingle bundle --> <script src="libs/strophejingle.bundle.js?v=1"></script><!-- strophe.jingle bundle -->
<script src="libs/colibri.js"></script><!-- colibri focus implementation --> <script src="libs/colibri.js?v=1"></script><!-- colibri focus implementation -->
<script src="muc.js"></script><!-- simple MUC library --> <script src="muc.js?v=2"></script><!-- simple MUC library -->
<script src="app.js"></script><!-- application logic --> <script src="estos_log.js?v=1"></script><!-- simple stanza logger -->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <script src="app.js?v=2"></script><!-- application logic -->
<link rel="stylesheet" type="text/css" media="screen" href="css/main.css" /> <link rel="stylesheet" href="font-awesome-4.0.3/css/font-awesome.css">
<link rel="stylesheet" href="css/jquery-impromptu.css"> <link rel="stylesheet" href="css/main.css?v=1"/>
<link rel="stylesheet" href="css/modaldialog.css"> <link rel="stylesheet" href="css/jquery-impromptu.css?v=1">
<link rel="stylesheet" href="css/modaldialog.css?v=1">
<script src="libs/jquery-impromptu.js"></script> <script src="libs/jquery-impromptu.js"></script>
<script src="libs/jquery.autosize.js"></script> <script src="libs/jquery.autosize.js"></script>
<script src="config.js"></script><!-- adapt to your needs, i.e. set hosts and bosh path --> <script src="config.js"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
<a class="button" onclick="openLinkDialog();"><i title="Invite others" class="fa fa-link fa-lg"></i></a> <a class="button" onclick="openLinkDialog();"><i title="Invite others" class="fa fa-link fa-lg"></i></a>
<div class="header_button_separator"></div> <div class="header_button_separator"></div>
<a class="button" onclick='openChat();'><i id="chat" title="Open chat" class="fa fa-comments fa-lg"></i></a> <a class="button" onclick='openChat();'><i id="chat" title="Open chat" class="fa fa-comments fa-lg"></i></a>
<!--i class='fa fa-external-link'>&nbsp;</i>Others can join you by just going to <span id='roomurl'></span--> <!--i class='fa fa-external-link'>&nbsp;</i>Others can join you by just going to <span id='roomurl'></span-->
</div> </div>
</div> </div>
<div id="settings"> <div id="settings">
...@@ -61,8 +62,13 @@ ...@@ -61,8 +62,13 @@
<div id="chatconversation"></div> <div id="chatconversation"></div>
<textarea id="usermsg" class= "animated" placeholder='Enter text...' autofocus></textarea> <textarea id="usermsg" class= "animated" placeholder='Enter text...' autofocus></textarea>
</div> </div>
<a id="downloadlog" class="fa fa-cloud-download" title="Download logfile for support" onclick="connection.logger.dump(event.target);" style="position: absolute; bottom: 5; left: 5; overflow: visible; z-index: 100;"></a>
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-319188-14', 'jit.si');
ga('send', 'pageview');
</script> </script>
</body> </body>
</html> </html>
...@@ -591,7 +591,7 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -591,7 +591,7 @@ public class PluginImpl implements Plugin, PropertyEventListener
if (vBridge != null) if (vBridge != null)
{ {
String focusAgentName = "colibri.focus.agent." + vBridge; String focusAgentName = "jitsi.videobridge." + vBridge;
JID user = iq.getFrom(); JID user = iq.getFrom();
Log.info("ColibriIQHandler handleColibriCommand bridge " + focusAgentName); Log.info("ColibriIQHandler handleColibriCommand bridge " + focusAgentName);
...@@ -629,7 +629,16 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -629,7 +629,16 @@ public class PluginImpl implements Plugin, PropertyEventListener
*/ */
public void roomDestroyed(JID roomJID) public void roomDestroyed(JID roomJID)
{ {
Log.info("ColibriIQHandler roomDestroyed " + roomJID);
String focusAgentName = "jitsi.videobridge." + roomJID.getNode();
if (sessions.containsKey(focusAgentName))
{
FocusAgent focusAgent = sessions.remove(focusAgentName);
focusAgent.closeSession();
focusAgent = null;
}
} }
/** /**
* *
...@@ -637,11 +646,11 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -637,11 +646,11 @@ public class PluginImpl implements Plugin, PropertyEventListener
*/ */
public void occupantJoined(JID roomJID, JID user, String nickname) public void occupantJoined(JID roomJID, JID user, String nickname)
{ {
MUCRoom mucRoom = mucManager.getMultiUserChatService(roomJID).getChatRoom(roomJID.getNode()); //MUCRoom mucRoom = mucManager.getMultiUserChatService(roomJID).getChatRoom(roomJID.getNode());
Log.info("ColibriIQHandler occupantJoined " + roomJID + " " + user + " " + nickname); Log.info("ColibriIQHandler occupantJoined " + roomJID + " " + user + " " + nickname);
String focusAgentName = "colibri.focus.agent." + roomJID.getNode(); String focusAgentName = "jitsi.videobridge." + roomJID.getNode();
FocusAgent focusAgent; FocusAgent focusAgent;
...@@ -654,7 +663,7 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -654,7 +663,7 @@ public class PluginImpl implements Plugin, PropertyEventListener
} else { } else {
focusAgent = new FocusAgent(focusAgentName, roomJID); focusAgent = new FocusAgent(focusAgentName, roomJID);
LocalClientSession session = SessionManager.getInstance().createClientSession(focusAgent, new BasicStreamID(focusAgentName + "-" + System.currentTimeMillis() ) ); LocalClientSession session = SessionManager.getInstance().createClientSession(focusAgent, new BasicStreamID(focusAgentName + "-" + System.currentTimeMillis() ) );
focusAgent.setRouter( new SessionPacketRouter(session)); focusAgent.setRouter( new SessionPacketRouter(session), session);
AuthToken authToken = new AuthToken(focusAgentName, true); AuthToken authToken = new AuthToken(focusAgentName, true);
session.setAuthToken(authToken, focusAgentName); session.setAuthToken(authToken, focusAgentName);
sessions.put(focusAgentName, focusAgent); sessions.put(focusAgentName, focusAgent);
...@@ -671,11 +680,11 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -671,11 +680,11 @@ public class PluginImpl implements Plugin, PropertyEventListener
*/ */
public void occupantLeft(JID roomJID, JID user) public void occupantLeft(JID roomJID, JID user)
{ {
MUCRoom mucRoom = mucManager.getMultiUserChatService(roomJID).getChatRoom(roomJID.getNode()); //MUCRoom mucRoom = mucManager.getMultiUserChatService(roomJID).getChatRoom(roomJID.getNode());
Log.info("ColibriIQHandler occupantLeft " + roomJID + " " + user); Log.info("ColibriIQHandler occupantLeft " + roomJID + " " + user);
String focusAgentName = "colibri.focus.agent." + roomJID.getNode(); String focusAgentName = "jitsi.videobridge." + roomJID.getNode();
if (sessions.containsKey(focusAgentName)) if (sessions.containsKey(focusAgentName))
{ {
...@@ -1147,7 +1156,7 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -1147,7 +1156,7 @@ public class PluginImpl implements Plugin, PropertyEventListener
public void closeColibri() public void closeColibri()
{ {
count = 0; count = 0;
focusId = null; // invalidate current focus session focusId = null; // invalidate current focus
if (mediaStream != null) if (mediaStream != null)
{ {
...@@ -1159,9 +1168,25 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -1159,9 +1168,25 @@ public class PluginImpl implements Plugin, PropertyEventListener
* *
* *
*/ */
public void setRouter(SessionPacketRouter router) public void setRouter(SessionPacketRouter router, LocalClientSession session)
{ {
this.router = router; this.router = router;
this.session = session;
}
/**
*
*
*/
public void closeSession()
{
Log.debug("FocusAgent - closeSession ");
if (session != null)
{
session.close();
session = null;
}
} }
/** /**
* *
...@@ -1169,7 +1194,7 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -1169,7 +1194,7 @@ public class PluginImpl implements Plugin, PropertyEventListener
*/ */
public void closeVirtualConnection() public void closeVirtualConnection()
{ {
Log.debug("FocusAgent - close "); Log.debug("FocusAgent - closeVirtualConnection ");
closeColibri(); closeColibri();
} }
/** /**
......
...@@ -700,7 +700,7 @@ ColibriFocus.prototype.modifySources = function () { ...@@ -700,7 +700,7 @@ ColibriFocus.prototype.modifySources = function () {
// FIXME: this is a big hack // FIXME: this is a big hack
// https://code.google.com/p/webrtc/issues/detail?id=2688 // https://code.google.com/p/webrtc/issues/detail?id=2688
if (!(this.peerconnection.signalingState == 'stable' && this.peerconnection.iceConnectionState == 'connected')) { if (!(this.peerconnection.iceConnectionState == 'connected')) {
console.warn('modifySources not yet', this.peerconnection.signalingState, this.peerconnection.iceConnectionState); console.warn('modifySources not yet', this.peerconnection.signalingState, this.peerconnection.iceConnectionState);
window.setTimeout(function () { ob.modifySources(); }, 250); window.setTimeout(function () { ob.modifySources(); }, 250);
this.wait = true; this.wait = true;
......
...@@ -75,18 +75,6 @@ Strophe.addConnectionPlugin('emuc', { ...@@ -75,18 +75,6 @@ Strophe.addConnectionPlugin('emuc', {
var from = pres.getAttribute('from'); var from = pres.getAttribute('from');
if ($(pres).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) { if ($(pres).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
$(document).trigger('passwordrequired.muc', [from]); $(document).trigger('passwordrequired.muc', [from]);
// FIXME: remove once moved to passwordrequired which should reuse dojoin
var ob = this;
window.setTimeout(function () {
var given = window.prompt('Password required');
if (given != null) {
// FIXME: reuse doJoin?
ob.connection.send($pres({to: ob.myroomjid }).c('x', {xmlns: 'http://jabber.org/protocol/muc'}).c('password').t(given));
} else {
// user aborted
}
}, 50);
} else { } else {
console.warn('onPresError ', pres); console.warn('onPresError ', pres);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment