Commit 90b14960 authored by Dele Olajide's avatar Dele Olajide Committed by dele

Jitsi Videobridge plugin - refresh with github, fix issues

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13879 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4f0936b9
...@@ -44,10 +44,10 @@ ...@@ -44,10 +44,10 @@
Jitsi Video Bridge Plugin Changelog Jitsi Video Bridge Plugin Changelog
</h1> </h1>
<p><b>1.1</b> -- Jan 7th, 2014</p> <p><b>1.1</b> -- Jan 27th, 2014</p>
<ul> <ul>
<li>OF-716 Added to Openfire plugins with embedded ofmeet web video conference application and Spark plugin</li> <li>OF-716 Added to Openfire plugins.</li>
</ul> </ul>
<p><b>1.0</b> -- Apr 12, 2013</p> <p><b>1.0</b> -- Apr 12, 2013</p>
......
var connection = null; var connection = null;
var userForm = null;
$(document).ready(function () $(document).ready(function ()
{ {
...@@ -25,6 +26,8 @@ $(document).ready(function () ...@@ -25,6 +26,8 @@ $(document).ready(function ()
function joinWorkgroup(workgroup, form) function joinWorkgroup(workgroup, form)
{ {
userForm = form;
if (connection != null && connection.connected) if (connection != null && connection.connected)
{ {
var iq = $iq({to: workgroup + "@workgroup." + connection.domain, type: 'set'}).c('join-queue', {xmlns: 'http://jabber.org/protocol/workgroup'}); var iq = $iq({to: workgroup + "@workgroup." + connection.domain, type: 'set'}).c('join-queue', {xmlns: 'http://jabber.org/protocol/workgroup'});
...@@ -63,7 +66,7 @@ function onMessage(message) ...@@ -63,7 +66,7 @@ function onMessage(message)
if (xmlns == "jabber:x:conference") if (xmlns == "jabber:x:conference")
{ {
var roomJid = $(this).attr("jid"); var roomJid = $(this).attr("jid");
window.location.href = "/ofmeet/?r=" + Strophe.getNodeFromJid(roomJid); window.location.href = "/ofmeet/?r=" + Strophe.getNodeFromJid(roomJid) + "&n=" + userForm.username + "&q=" + userForm.question;
} }
}); });
return true; return true;
......
...@@ -4,7 +4,9 @@ var config = { ...@@ -4,7 +4,9 @@ var config = {
muc: 'conference.' + window.location.hostname, // FIXME: use XEP-0030 muc: 'conference.' + window.location.hostname, // FIXME: use XEP-0030
bridge: 'jitsi-videobridge.' + window.location.hostname // FIXME: use XEP-0030 bridge: 'jitsi-videobridge.' + window.location.hostname // FIXME: use XEP-0030
}, },
useIPv6: false, // ipv6 support. use at your own risk
useNicks: false, useNicks: false,
useWebsockets: true, useWebsockets: true,
resolution: "360",
bosh: window.location.protocol + "//" + window.location.host + '/http-bind/' // FIXME: use xep-0156 for that bosh: window.location.protocol + "//" + window.location.host + '/http-bind/' // FIXME: use xep-0156 for that
}; };
...@@ -86,7 +86,7 @@ $(document).ready(function () ...@@ -86,7 +86,7 @@ $(document).ready(function ()
$("#screen").addClass("fa-border"); $("#screen").addClass("fa-border");
} else { } else {
getConstraints(['audio', 'video'], '720'); getConstraints(['audio', 'video'], config.resolution);
$("#screen").removeClass("fa-border"); $("#screen").removeClass("fa-border");
} }
...@@ -129,7 +129,7 @@ $(document).bind('mediafailure.rayo', function(error) { ...@@ -129,7 +129,7 @@ $(document).bind('mediafailure.rayo', function(error) {
$(document).bind('remotestreamadded.rayo', function(event, data, sid) $(document).bind('remotestreamadded.rayo', function(event, data, sid)
{ {
var id = 'remoteVideo_' + sid + '_' + data.stream.id; var id = 'remoteVideo_' + data.stream.id;
if (!document.getElementById(id)) if (!document.getElementById(id))
{ {
...@@ -145,15 +145,16 @@ $(document).bind('remotestreamadded.rayo', function(event, data, sid) ...@@ -145,15 +145,16 @@ $(document).bind('remotestreamadded.rayo', function(event, data, sid)
window.RTC.attachMediaStream(sel, data.stream); window.RTC.attachMediaStream(sel, data.stream);
if (sel.attr('id').indexOf('mixedmslabel') == -1) { if (sel.attr('id') && sel.attr('id').indexOf('mixedmslabel') == -1) {
// ignore mixedmslabela0 and non room members // ignore mixedmslabela0 and non room members
sel.show(); sel.show();
resizeThumbnails();
document.getElementById('largeVideo').volume = 1; document.getElementById('largeVideo').volume = 1;
$('#largeVideo').attr('src', sel.attr('src')); $('#largeVideo').attr('src', sel.attr('src'));
} }
resizeThumbnails();
data.stream.onended = function() { data.stream.onended = function() {
console.log('stream ended', this.id); console.log('stream ended', this.id);
var src = $('#' + id).attr('src'); var src = $('#' + id).attr('src');
...@@ -416,8 +417,9 @@ function urlParam(name) ...@@ -416,8 +417,9 @@ function urlParam(name)
function doJoin() { function doJoin() {
var roomnode = urlParam("r"); var roomnode = urlParam("r");
nickname = unescape(urlParam("n"));
console.log("doJoin", roomnode); console.log("doJoin", roomnode, nickname);
if (!roomnode) { if (!roomnode) {
roomnode = Math.random().toString(36).substr(2, 20); roomnode = Math.random().toString(36).substr(2, 20);
...@@ -432,21 +434,35 @@ function doJoin() { ...@@ -432,21 +434,35 @@ function doJoin() {
if (nick) { if (nick) {
myroomjid += '/' + nick; myroomjid += '/' + nick;
nickname = nick; nickname = nick;
$('#nickname').css({visibility:"hidden"});
$('#ofmeet').css({visibility:'visible'});
$('#usermsg').css({visibility:'visible'});
} else { } else {
myroomjid += '/' + Strophe.getNodeFromJid(connection.jid); myroomjid += '/' + Strophe.getNodeFromJid(connection.jid);
} }
} else { } else {
if (nickname)
myroomjid += '/' + nickname;
else
myroomjid += '/' + Strophe.getNodeFromJid(connection.jid); myroomjid += '/' + Strophe.getNodeFromJid(connection.jid);
} }
connection.addHandler(rayoCallback, 'urn:xmpp:rayo:colibri:1'); connection.addHandler(rayoCallback, 'urn:xmpp:rayo:colibri:1');
connection.emuc.doJoin(myroomjid); connection.emuc.doJoin(myroomjid);
if (nickname)
{
var question = unescape(urlParam("q"));
if (question) updateChatConversation(nickname, question);
$('#nickname').css({visibility:"hidden"});
$('#ofmeet').css({visibility:'visible'});
$('#usermsg').css({visibility:'visible'});
openChat();
}
} }
function rayoCallback(presence) function rayoCallback(presence)
{ {
console.log("rayoCallback", presence); console.log("rayoCallback", presence);
...@@ -573,13 +589,11 @@ function handleOffer (from, offer) ...@@ -573,13 +589,11 @@ function handleOffer (from, offer)
var confid = null; var confid = null;
var channelId = []; var channelId = [];
window.RTC.rayo.channels = {}
window.RTC.rayo.addssrc = false; window.RTC.rayo.addssrc = false;
$(offer).find('conference').each(function() $(offer).find('conference').each(function()
{ {
confid = $(this).attr('id'); confid = $(this).attr('id');
window.RTC.rayo.channels.id = confid;
$(this).find('content').each(function() $(this).find('content').each(function()
{ {
...@@ -647,11 +661,10 @@ function handleOffer (from, offer) ...@@ -647,11 +661,10 @@ function handleOffer (from, offer)
}); });
bridgeSDP.raw = bridgeSDP.session + bridgeSDP.media.join(''); bridgeSDP.raw = bridgeSDP.session + bridgeSDP.media.join('');
window.RTC.rayo.channels.sdp = bridgeSDP.raw;
//console.log("bridgeSDP.raw", bridgeSDP.raw); //console.log("bridgeSDP.raw", bridgeSDP.raw);
window.RTC.rayo.pc[videobridge] = new window.RTC.peerconnection(null, {'optional': [{'DtlsSrtpKeyAgreement': 'true'}]}); window.RTC.rayo.pc[videobridge] = new window.RTC.peerconnection(null, {'optional': [{'DtlsSrtpKeyAgreement': 'true'}, {googIPv6: config.useIPv6}]});
window.RTC.rayo.pc[videobridge].onicecandidate = function(event) window.RTC.rayo.pc[videobridge].onicecandidate = function(event)
......
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