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, $) {
var name = Strophe.getNodeFromJid(jid);
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);
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"}));
});
......@@ -206,6 +207,7 @@ CandyShop.Fastpath = (function(self, Candy, $) {
var workGroup = 'workgroup-' + nick + "@conference." + connection.domain;
var free = true;
var count, oldest, waitTime, status
var room = Candy.View.Pane.Room.getPane(workGroup, '.message-pane')
presence.find('count').each(function()
{
......@@ -233,10 +235,10 @@ CandyShop.Fastpath = (function(self, Candy, $) {
console.log('notify-queue message to ' + workGroup);
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");
});
}
......
......@@ -904,87 +904,96 @@ CandyShop.Videobridge = (function(self, Candy, $) {
$(document).trigger('mediafailure.rayo');
}
};
var getConstraints = function(um, resolution, bandwidth, fps)
{
console.log("getConstraints", um, resolution, bandwidth, fps);
window.RTC.rayo.constraints = {audio: false, video: false};
console.log("getConstraints", um, resolution, bandwidth, fps);
if (um.indexOf('video') >= 0) {
window.RTC.rayo.constraints.video = {mandatory: {}};// same behaviour as true
}
if (um.indexOf('audio') >= 0) {
window.RTC.rayo.constraints = {audio: false, video: false};
if (um.indexOf('video') >= 0) {
window.RTC.rayo.constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
}
if (um.indexOf('audio') >= 0) {
window.RTC.rayo.constraints.audio = {};// same behaviour as true
}
if (um.indexOf('screen') >= 0) {
}
if (um.indexOf('screen') >= 0) {
window.RTC.rayo.constraints.video = {
"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) {
window.RTC.rayo.constraints.video = {mandatory: {}};// same behaviour as true
}
// see https://code.google.com/p/chromium/issues/detail?id=143631#c9 for list of supported resolutions
switch (resolution) {
// 16:9 first
case '1080':
case 'fullhd':
window.RTC.rayo.constraints.video.mandatory.minWidth = 1920;
window.RTC.rayo.constraints.video.mandatory.minHeight = 1080;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77;
break;
case '720':
case 'hd':
window.RTC.rayo.constraints.video.mandatory.minWidth = 1280;
window.RTC.rayo.constraints.video.mandatory.minHeight = 720;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77;
break;
case '360':
window.RTC.rayo.constraints.video.mandatory.minWidth = 640;
window.RTC.rayo.constraints.video.mandatory.minHeight = 360;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77;
break;
case '180':
window.RTC.rayo.constraints.video.mandatory.minWidth = 320;
window.RTC.rayo.constraints.video.mandatory.minHeight = 180;
window.RTC.rayo.constraints.video.mandatory.minAspectRatio = 1.77;
break;
} else
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
switch (resolution) {
// 16:9 first
case '1080':
case 'fullhd':
window.RTC.rayo.constraints.video.mandatory.minWidth = 1920;
window.RTC.rayo.constraints.video.mandatory.minHeight = 1080;
window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break;
case '720':
case 'hd':
window.RTC.rayo.constraints.video.mandatory.minWidth = 1280;
window.RTC.rayo.constraints.video.mandatory.minHeight = 720;
window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break;
case '360':
window.RTC.rayo.constraints.video.mandatory.minWidth = 640;
window.RTC.rayo.constraints.video.mandatory.minHeight = 360;
window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break;
case '180':
window.RTC.rayo.constraints.video.mandatory.minWidth = 320;
window.RTC.rayo.constraints.video.mandatory.minHeight = 180;
window.RTC.rayo.constraints.video.optional.push({ minAspectRatio: 1.77 });
break;
// 4:3
case '960':
window.RTC.rayo.constraints.video.mandatory.minWidth = 960;
window.RTC.rayo.constraints.video.mandatory.minHeight = 720;
break;
case '640':
case 'vga':
window.RTC.rayo.constraints.video.mandatory.minWidth = 640;
window.RTC.rayo.constraints.video.mandatory.minHeight = 480;
break;
case '320':
window.RTC.rayo.constraints.video.mandatory.minWidth = 320;
window.RTC.rayo.constraints.video.mandatory.minHeight = 240;
break;
default:
if (navigator.userAgent.indexOf('Android') != -1) {
window.RTC.rayo.constraints.video.mandatory.minWidth = 320;
window.RTC.rayo.constraints.video.mandatory.minHeight = 240;
window.RTC.rayo.constraints.video.mandatory.maxFrameRate = 15;
case '960':
window.RTC.rayo.constraints.video.mandatory.minWidth = 960;
window.RTC.rayo.constraints.video.mandatory.minHeight = 720;
break;
case '640':
case 'vga':
window.RTC.rayo.constraints.video.mandatory.minWidth = 640;
window.RTC.rayo.constraints.video.mandatory.minHeight = 480;
break;
case '320':
window.RTC.rayo.constraints.video.mandatory.minWidth = 320;
window.RTC.rayo.constraints.video.mandatory.minHeight = 240;
break;
default:
if (navigator.userAgent.indexOf('Android') != -1) {
window.RTC.rayo.constraints.video.mandatory.minWidth = 320;
window.RTC.rayo.constraints.video.mandatory.minHeight = 240;
window.RTC.rayo.constraints.video.mandatory.maxFrameRate = 15;
}
break;
}
break;
}
}
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 (bandwidth) { // doesn't work currently, see webrtc issue 1846
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}];
}
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
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;
}
}
}
}
return self;
}(CandyShop.Videobridge || {}, Candy, jQuery));
......@@ -12,6 +12,6 @@
<link rel="stylesheet" href="css/fastpath.css">
</head>
<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>
</html>
......@@ -1936,6 +1936,8 @@ public class PluginImpl implements Plugin, PropertyEventListener
{
Log.info("FocusAgent deliver\n" + packet);
if (packet instanceof IQ == false) return;
IQ iq = (IQ) packet;
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