You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Use 'ideal' rather than 'exact' for deviceid
We were using 'exact' which means we fail outright if the device we wanted isn't available. This means if a user selects a specific device then later unplugs it, we fail to open a capture device the next time they make a call even if there's one available. Using 'ideal' uses the chosen device in preference, but something else if it isn't available. Also log the name of the exception when we fail to open a capture device to give us more of an idea of what's gone wrong. Should help fix https://github.com/vector-im/riot-web/issues/8993
This commit is contained in:
@@ -583,7 +583,7 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) {
|
||||
' Or possibly you are using an insecure domain. Receiving only.');
|
||||
this.peerConn = _createPeerConnection(this);
|
||||
} else {
|
||||
debuglog('Failed to getUserMedia.');
|
||||
debuglog('Failed to getUserMedia: ' + error.name);
|
||||
this._getUserMediaFailed(error);
|
||||
return;
|
||||
}
|
||||
@@ -1274,15 +1274,15 @@ const _getUserMediaVideoContraints = function(callType) {
|
||||
case 'voice':
|
||||
return {
|
||||
audio: {
|
||||
deviceId: audioInput ? {exact: audioInput} : undefined,
|
||||
deviceId: audioInput ? {ideal: audioInput} : undefined,
|
||||
}, video: false,
|
||||
};
|
||||
case 'video':
|
||||
return {
|
||||
audio: {
|
||||
deviceId: audioInput ? {exact: audioInput} : undefined,
|
||||
deviceId: audioInput ? {ideal: audioInput} : undefined,
|
||||
}, video: {
|
||||
deviceId: videoInput ? {exact: videoInput} : undefined,
|
||||
deviceId: videoInput ? {ideal: videoInput} : undefined,
|
||||
/* We want 640x360. Chrome will give it only if we ask exactly,
|
||||
FF refuses entirely if we ask exactly, so have to ask for ideal
|
||||
instead */
|
||||
|
||||
Reference in New Issue
Block a user