Commit f1ba423c authored by Dele Olajide's avatar Dele Olajide

Jitsi Videobridge: Upgraded Candy app to latest webrtc changes

parent 6ecf7405
...@@ -69,9 +69,10 @@ CandyShop.Fastpath = (function(self, Candy, $) { ...@@ -69,9 +69,10 @@ CandyShop.Fastpath = (function(self, Candy, $) {
var name = Strophe.getNodeFromJid(jid); var name = Strophe.getNodeFromJid(jid);
var chatRoom = 'workgroup-' + name + "@conference." + connection.domain; var chatRoom = 'workgroup-' + name + "@conference." + connection.domain;
connection.send($pres({to: jid}).c('agent-status', {'xmlns': "http://jabber.org/protocol/workgroup"}));
Candy.Core.Action.Jabber.Room.Join(chatRoom); Candy.Core.Action.Jabber.Room.Join(chatRoom);
connection.send($pres({to: jid}).c('agent-status', {'xmlns': "http://jabber.org/protocol/workgroup"})); connection.send($pres({to: jid}).c("status").t("Online").up().c("priority").t("1"));
connection.sendIQ($iq({type: 'get', to: jid}).c('agent-status-request', {xmlns: "http://jabber.org/protocol/workgroup"})); connection.sendIQ($iq({type: 'get', to: jid}).c('agent-status-request', {xmlns: "http://jabber.org/protocol/workgroup"}));
}); });
...@@ -206,6 +207,7 @@ CandyShop.Fastpath = (function(self, Candy, $) { ...@@ -206,6 +207,7 @@ CandyShop.Fastpath = (function(self, Candy, $) {
var workGroup = 'workgroup-' + nick + "@conference." + connection.domain; var workGroup = 'workgroup-' + nick + "@conference." + connection.domain;
var free = true; var free = true;
var count, oldest, waitTime, status var count, oldest, waitTime, status
var room = Candy.View.Pane.Room.getPane(workGroup, '.message-pane')
presence.find('count').each(function() presence.find('count').each(function()
{ {
...@@ -233,10 +235,10 @@ CandyShop.Fastpath = (function(self, Candy, $) { ...@@ -233,10 +235,10 @@ CandyShop.Fastpath = (function(self, Candy, $) {
console.log('notify-queue message to ' + workGroup); console.log('notify-queue message to ' + workGroup);
var text = "There are " + count + " caller(s) waiting for as long as " + waitTime + " seconds"; var text = "There are " + count + " caller(s) waiting for as long as " + waitTime + " seconds";
Candy.View.Pane.Message.show(workGroup, nick, text); if (room) Candy.View.Pane.Message.show(workGroup, nick, text);
} }
if (free) Candy.View.Pane.Message.show(workGroup, nick, "No waiting conversations"); if (free && room) Candy.View.Pane.Message.show(workGroup, nick, "No waiting conversations");
}); });
} }
......
...@@ -912,22 +912,29 @@ CandyShop.Videobridge = (function(self, Candy, $) { ...@@ -912,22 +912,29 @@ CandyShop.Videobridge = (function(self, Candy, $) {
window.RTC.rayo.constraints = {audio: false, video: false}; window.RTC.rayo.constraints = {audio: false, video: false};
if (um.indexOf('video') >= 0) { if (um.indexOf('video') >= 0) {
window.RTC.rayo.constraints.video = {mandatory: {}};// same behaviour as true window.RTC.rayo.constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
} }
if (um.indexOf('audio') >= 0) { if (um.indexOf('audio') >= 0) {
window.RTC.rayo.constraints.audio = {};// same behaviour as true window.RTC.rayo.constraints.audio = {};// same behaviour as true
} }
if (um.indexOf('screen') >= 0) { if (um.indexOf('screen') >= 0) {
window.RTC.rayo.constraints.video = { window.RTC.rayo.constraints.video = {
"mandatory": { "mandatory": {
"chromeMediaSource": "screen" "chromeMediaSource": "screen",
} "googLeakyBucket": true,
"maxWidth": window.screen.width,
"maxHeight": window.screen.height,
"maxFrameRate": "3"
},
optional: []
}; };
}
if (resolution && !window.RTC.rayo.constraints.video) { } else
window.RTC.rayo.constraints.video = {mandatory: {}};// same behaviour as true
} if (resolution && window.RTC.rayo.constraints.video)
{
window.RTC.rayo.constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
// see https://code.google.com/p/chromium/issues/detail?id=143631#c9 for list of supported resolutions // see https://code.google.com/p/chromium/issues/detail?id=143631#c9 for list of supported resolutions
switch (resolution) { switch (resolution) {
// 16:9 first // 16:9 first
...@@ -935,23 +942,23 @@ CandyShop.Videobridge = (function(self, Candy, $) { ...@@ -935,23 +942,23 @@ CandyShop.Videobridge = (function(self, Candy, $) {
case 'fullhd': case 'fullhd':
window.RTC.rayo.constraints.video.mandatory.minWidth = 1920; window.RTC.rayo.constraints.video.mandatory.minWidth = 1920;
window.RTC.rayo.constraints.video.mandatory.minHeight = 1080; window.RTC.rayo.constraints.video.mandatory.minHeight = 1080;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77; window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
case '720': case '720':
case 'hd': case 'hd':
window.RTC.rayo.constraints.video.mandatory.minWidth = 1280; window.RTC.rayo.constraints.video.mandatory.minWidth = 1280;
window.RTC.rayo.constraints.video.mandatory.minHeight = 720; window.RTC.rayo.constraints.video.mandatory.minHeight = 720;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77; window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
case '360': case '360':
window.RTC.rayo.constraints.video.mandatory.minWidth = 640; window.RTC.rayo.constraints.video.mandatory.minWidth = 640;
window.RTC.rayo.constraints.video.mandatory.minHeight = 360; window.RTC.rayo.constraints.video.mandatory.minHeight = 360;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77; window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
case '180': case '180':
window.RTC.rayo.constraints.video.mandatory.minWidth = 320; window.RTC.rayo.constraints.video.mandatory.minWidth = 320;
window.RTC.rayo.constraints.video.mandatory.minHeight = 180; window.RTC.rayo.constraints.video.mandatory.minHeight = 180;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77; window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
// 4:3 // 4:3
case '960': case '960':
...@@ -975,16 +982,18 @@ CandyShop.Videobridge = (function(self, Candy, $) { ...@@ -975,16 +982,18 @@ CandyShop.Videobridge = (function(self, Candy, $) {
} }
break; break;
} }
}
if (bandwidth) { // doesn't work currently, see webrtc issue 1846 if (bandwidth) { // doesn't work currently, see webrtc issue 1846
if (!window.RTC.rayo.constraints.video) window.RTC.rayo.constraints.video = {mandatory: {}};//same behaviour as true if (!window.RTC.rayo.constraints.video) window.RTC.rayo.constraints.video = { mandatory: {}, optional: [] };//same behaviour as true
window.RTC.rayo.constraints.video.optional = [{bandwidth: bandwidth}]; window.RTC.rayo.constraints.video.optional = [{bandwidth: bandwidth}];
} }
if (fps) { // for some cameras it might be necessary to request 30fps if (fps) { // for some cameras it might be necessary to request 30fps
// so they choose 30fps mjpg over 10fps yuy2 // so they choose 30fps mjpg over 10fps yuy2
if (!window.RTC.rayo.constraints.video) window.RTC.rayo.constraints.video = {mandatory: {}};// same behaviour as tru; if (!window.RTC.rayo.constraints.video) window.RTC.rayo.constraints.video = { mandatory: {}, optional: [] };// same behaviour as tru;
window.RTC.rayo.constraints.video.mandatory.minFrameRate = fps; window.RTC.rayo.constraints.video.mandatory.minFrameRate = fps;
} }
} }
return self; return self;
}(CandyShop.Videobridge || {}, Candy, jQuery)); }(CandyShop.Videobridge || {}, Candy, jQuery));
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
<link rel="stylesheet" href="css/fastpath.css"> <link rel="stylesheet" href="css/fastpath.css">
</head> </head>
<body> <body>
<button onclick="joinWorkgroup('flowers', {username: 'John Doe', email: 'john@large', question: 'what is the meaning of life'})" id="fastpath">Offline</button> <button onclick="joinWorkgroup('programming', {username: 'John Doe', email: 'john@large', question: 'what is the meaning of life'})" id="fastpath">Offline</button>
</body> </body>
</html> </html>
...@@ -1936,6 +1936,8 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -1936,6 +1936,8 @@ public class PluginImpl implements Plugin, PropertyEventListener
{ {
Log.info("FocusAgent deliver\n" + packet); Log.info("FocusAgent deliver\n" + packet);
if (packet instanceof IQ == false) return;
IQ iq = (IQ) packet; IQ iq = (IQ) packet;
if (iq.getType() == IQ.Type.result) if (iq.getType() == IQ.Type.result)
......
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