Commit 1b6d3b74 authored by Dele Olajide's avatar Dele Olajide

Jitsi Videobridge: Fixes Jitsi VideoBridge Plugin problem redirects to...

Jitsi Videobridge: Fixes Jitsi VideoBridge Plugin problem redirects to webrtcrequired.html. See https://community.igniterealtime.org/thread/52934
parent a60eefe2
...@@ -510,7 +510,7 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res ...@@ -510,7 +510,7 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
var constraints = {audio: false, video: false}; var constraints = {audio: false, video: false};
if (um.indexOf('video') >= 0) { if (um.indexOf('video') >= 0) {
constraints.video = {mandatory: {}};// same behaviour as true constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
} }
if (um.indexOf('audio') >= 0) { if (um.indexOf('audio') >= 0) {
constraints.audio = {};// same behaviour as true constraints.audio = {};// same behaviour as true
...@@ -519,10 +519,12 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res ...@@ -519,10 +519,12 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
constraints.video = { constraints.video = {
mandatory: { mandatory: {
chromeMediaSource: "screen", chromeMediaSource: "screen",
googLeakyBucket: true,
maxWidth: window.screen.width, maxWidth: window.screen.width,
maxHeight: window.screen.height, maxHeight: window.screen.height,
maxFrameRate: 3 maxFrameRate: 3
} },
optional: []
}; };
} }
if (um.indexOf('desktop') >= 0) { if (um.indexOf('desktop') >= 0) {
...@@ -530,10 +532,12 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res ...@@ -530,10 +532,12 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
mandatory: { mandatory: {
chromeMediaSource: "desktop", chromeMediaSource: "desktop",
chromeMediaSourceId: desktopStream, chromeMediaSourceId: desktopStream,
googLeakyBucket: true,
maxWidth: window.screen.width, maxWidth: window.screen.width,
maxHeight: window.screen.height, maxHeight: window.screen.height,
maxFrameRate: 3 maxFrameRate: 3
} },
optional: []
} }
} }
...@@ -541,7 +545,7 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res ...@@ -541,7 +545,7 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
var isAndroid = navigator.userAgent.indexOf('Android') != -1; var isAndroid = navigator.userAgent.indexOf('Android') != -1;
if (resolution && !constraints.video || isAndroid) { if (resolution && !constraints.video || isAndroid) {
constraints.video = {mandatory: {}};// same behaviour as true 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) {
...@@ -550,23 +554,23 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res ...@@ -550,23 +554,23 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
case 'fullhd': case 'fullhd':
constraints.video.mandatory.minWidth = 1920; constraints.video.mandatory.minWidth = 1920;
constraints.video.mandatory.minHeight = 1080; constraints.video.mandatory.minHeight = 1080;
constraints.video.mandatory.minAspectRatio = 1.77; constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
case '720': case '720':
case 'hd': case 'hd':
constraints.video.mandatory.minWidth = 1280; constraints.video.mandatory.minWidth = 1280;
constraints.video.mandatory.minHeight = 720; constraints.video.mandatory.minHeight = 720;
constraints.video.mandatory.minAspectRatio = 1.77; constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
case '360': case '360':
constraints.video.mandatory.minWidth = 640; constraints.video.mandatory.minWidth = 640;
constraints.video.mandatory.minHeight = 360; constraints.video.mandatory.minHeight = 360;
constraints.video.mandatory.minAspectRatio = 1.77; constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
case '180': case '180':
constraints.video.mandatory.minWidth = 320; constraints.video.mandatory.minWidth = 320;
constraints.video.mandatory.minHeight = 180; constraints.video.mandatory.minHeight = 180;
constraints.video.mandatory.minAspectRatio = 1.77; constraints.video.optional.push({ minAspectRatio: 1.77 });
break; break;
// 4:3 // 4:3
case '960': case '960':
...@@ -592,12 +596,12 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res ...@@ -592,12 +596,12 @@ function getUserMediaWithConstraints(um, success_callback, failure_callback, res
} }
if (bandwidth) { // doesn't work currently, see webrtc issue 1846 if (bandwidth) { // doesn't work currently, see webrtc issue 1846
if (!constraints.video) constraints.video = {mandatory: {}};//same behaviour as true if (!constraints.video) constraints.video = { mandatory: {}, optional: [] };//same behaviour as true
constraints.video.optional = [{bandwidth: bandwidth}]; 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 (!constraints.video) constraints.video = {mandatory: {}};// same behaviour as tru; if (!constraints.video) constraints.video = { mandatory: {}, optional: [] };// same behaviour as tru;
constraints.video.mandatory.minFrameRate = fps; constraints.video.mandatory.minFrameRate = fps;
} }
......
...@@ -451,7 +451,7 @@ function getConstraints(um, resolution, bandwidth, fps) ...@@ -451,7 +451,7 @@ function getConstraints(um, resolution, bandwidth, fps)
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
...@@ -461,17 +461,19 @@ function getConstraints(um, resolution, bandwidth, fps) ...@@ -461,17 +461,19 @@ function getConstraints(um, resolution, bandwidth, fps)
window.RTC.rayo.constraints.video = { window.RTC.rayo.constraints.video = {
"mandatory": { "mandatory": {
"chromeMediaSource": "screen", "chromeMediaSource": "screen",
"googLeakyBucket": true,
"maxWidth": window.screen.width, "maxWidth": window.screen.width,
"maxHeight": window.screen.height, "maxHeight": window.screen.height,
"maxFrameRate": "3" "maxFrameRate": "3"
} },
optional: []
}; };
} else } else
if (resolution && window.RTC.rayo.constraints.video) if (resolution && window.RTC.rayo.constraints.video)
{ {
window.RTC.rayo.constraints.video = {mandatory: {}};// same behaviour as true 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
...@@ -479,23 +481,23 @@ function getConstraints(um, resolution, bandwidth, fps) ...@@ -479,23 +481,23 @@ function getConstraints(um, resolution, bandwidth, fps)
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':
...@@ -522,16 +524,17 @@ function getConstraints(um, resolution, bandwidth, fps) ...@@ -522,16 +524,17 @@ function getConstraints(um, resolution, bandwidth, fps)
} }
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;
} }
} }
function positionLarge (videoWidth, videoHeight) function positionLarge (videoWidth, videoHeight)
{ {
var videoSpaceWidth = $('#videospace').width(); var videoSpaceWidth = $('#videospace').width();
......
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