1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

switch to using new media constraints to allow device selection to work

This commit is contained in:
Matthew Hodgson
2017-06-01 21:57:58 +01:00
parent de844f1a32
commit 6989f6c835

View File

@@ -1219,6 +1219,8 @@ const _getScreenSharingConstraints = function(call) {
}; };
const _getUserMediaVideoContraints = function(callType) { const _getUserMediaVideoContraints = function(callType) {
const isWebkit = !!global.window.navigator.webkitGetUserMedia;
switch (callType) { switch (callType) {
case 'voice': case 'voice':
return { return {
@@ -1232,12 +1234,11 @@ const _getUserMediaVideoContraints = function(callType) {
deviceId: audioInput ? {exact: audioInput} : undefined, deviceId: audioInput ? {exact: audioInput} : undefined,
}, video: { }, video: {
deviceId: videoInput ? {exact: videoInput} : undefined, deviceId: videoInput ? {exact: videoInput} : undefined,
mandatory: { /* We want 640x360. Chrome will give it only if we ask exactly,
minWidth: 640, FF refuses entirely if we ask exactly, so have to ask for ideal
maxWidth: 640, instead */
minHeight: 360, width: isWebkit ? { exact: 640 } : { ideal: 640 },
maxHeight: 360, height: isWebkit ? { exact: 360 } : { ideal: 360 },
},
}, },
}; };
} }