More resolution tests.

master
Håvar Aambø Fosstveit 2018-06-18 10:18:31 +02:00
parent 7857ae27dd
commit 24c5929e5b
2 changed files with 28 additions and 92 deletions

View File

@ -18,6 +18,11 @@ const ROOM_OPTIONS =
} }
}; };
const VIDEO_CONSTRAINS =
{
width : { ideal: 3840 }
};
export default class RoomClient export default class RoomClient
{ {
constructor( constructor(
@ -462,37 +467,14 @@ export default class RoomClient
logger.debug('changeWebcam() | calling getUserMedia()'); logger.debug('changeWebcam() | calling getUserMedia()');
if (this._device.flag !== 'chrome') return navigator.mediaDevices.getUserMedia(
return navigator.mediaDevices.getUserMedia( {
video :
{ {
video : deviceId : { exact: device.deviceId },
{ ...VIDEO_CONSTRAINS
deviceId : { exact: device.deviceId }, }
width : { ideal: 3840 } });
}
});
else
return navigator.mediaDevices.getUserMedia(
{
video :
{
deviceId : { exact: device.deviceId },
optional : [
{ minWidth: 160 },
{ minWidth: 176 },
{ minWidth: 320 },
{ minWidth: 352 },
{ minWidth: 640 },
{ minWidth: 800 },
{ minWidth: 1024 },
{ minWidth: 1280 },
{ minWidth: 1600 },
{ minWidth: 1920 },
{ minWidth: 2560 },
{ minWidth: 3840 }
]
}
});
}) })
.then((stream) => .then((stream) =>
{ {
@ -563,37 +545,14 @@ export default class RoomClient
logger.debug('changeWebcamResolution() | calling getUserMedia()'); logger.debug('changeWebcamResolution() | calling getUserMedia()');
if (this._device.flag !== 'chrome') return navigator.mediaDevices.getUserMedia(
return navigator.mediaDevices.getUserMedia( {
video :
{ {
video : deviceId : { exact: device.deviceId },
{ ...VIDEO_CONSTRAINS
deviceId : { exact: device.deviceId }, }
width : { ideal: 3840 } });
}
});
else
return navigator.mediaDevices.getUserMedia(
{
video :
{
deviceId : { exact: device.deviceId },
optional : [
{ minWidth: 160 },
{ minWidth: 176 },
{ minWidth: 320 },
{ minWidth: 352 },
{ minWidth: 640 },
{ minWidth: 800 },
{ minWidth: 1024 },
{ minWidth: 1280 },
{ minWidth: 1600 },
{ minWidth: 1920 },
{ minWidth: 2560 },
{ minWidth: 3840 }
]
}
});
}) })
.then((stream) => .then((stream) =>
{ {
@ -1496,37 +1455,14 @@ export default class RoomClient
logger.debug('_setWebcamProducer() | calling getUserMedia()'); logger.debug('_setWebcamProducer() | calling getUserMedia()');
if (this._device.flag !== 'chrome') return navigator.mediaDevices.getUserMedia(
return navigator.mediaDevices.getUserMedia( {
video :
{ {
video : deviceId : { exact: device.deviceId },
{ ...VIDEO_CONSTRAINS
deviceId : { exact: device.deviceId }, }
width : { ideal: 3840 } });
}
});
else
return navigator.mediaDevices.getUserMedia(
{
video :
{
deviceId : { exact: device.deviceId },
optional : [
{ minWidth: 160 },
{ minWidth: 176 },
{ minWidth: 320 },
{ minWidth: 352 },
{ minWidth: 640 },
{ minWidth: 800 },
{ minWidth: 1024 },
{ minWidth: 1280 },
{ minWidth: 1600 },
{ minWidth: 1920 },
{ minWidth: 2560 },
{ minWidth: 3840 }
]
}
});
}) })
.then((stream) => .then((stream) =>
{ {

View File

@ -47,9 +47,9 @@ body {
// Hack to detect in JS the current media query // Hack to detect in JS the current media query
#multiparty-meeting-media-query-detector { #multiparty-meeting-media-query-detector {
position: relative; position: absolute;
z-index: -1000; z-index: -1000;
bottom: 1px; bottom: 0;
left: 0; left: 0;
height: 1px; height: 1px;
width: 1px; width: 1px;