Skip to content

Commit 5308595

Browse files
authored
Merge pull request #852 from matrix-org/dbkr/getusermedia_deviceid_ideal
Use 'ideal' rather than 'exact' for deviceid
2 parents 2363978 + e726e29 commit 5308595

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/matrix.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,21 @@ module.exports.createNewMatrixCall = require("./webrtc/call").createNewMatrixCal
8888

8989

9090
/**
91-
* Set an audio output device to use for MatrixCalls
91+
* Set a preferred audio output device to use for MatrixCalls
9292
* @function
9393
* @param {string=} deviceId the identifier for the device
9494
* undefined treated as unset
9595
*/
9696
module.exports.setMatrixCallAudioOutput = require('./webrtc/call').setAudioOutput;
9797
/**
98-
* Set an audio input device to use for MatrixCalls
98+
* Set a preferred audio input device to use for MatrixCalls
9999
* @function
100100
* @param {string=} deviceId the identifier for the device
101101
* undefined treated as unset
102102
*/
103103
module.exports.setMatrixCallAudioInput = require('./webrtc/call').setAudioInput;
104104
/**
105-
* Set a video input device to use for MatrixCalls
105+
* Set a preferred video input device to use for MatrixCalls
106106
* @function
107107
* @param {string=} deviceId the identifier for the device
108108
* undefined treated as unset

src/webrtc/call.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) {
583583
' Or possibly you are using an insecure domain. Receiving only.');
584584
this.peerConn = _createPeerConnection(this);
585585
} else {
586-
debuglog('Failed to getUserMedia.');
586+
debuglog('Failed to getUserMedia: ' + error.name);
587587
this._getUserMediaFailed(error);
588588
return;
589589
}
@@ -652,7 +652,7 @@ MatrixCall.prototype._maybeGotUserMediaForAnswer = function(stream) {
652652
debuglog('User denied access to camera/microphone.' +
653653
' Or possibly you are using an insecure domain. Receiving only.');
654654
} else {
655-
debuglog('Failed to getUserMedia.');
655+
debuglog('Failed to getUserMedia: ' + error.name);
656656
this._getUserMediaFailed(error);
657657
return;
658658
}
@@ -1274,15 +1274,15 @@ const _getUserMediaVideoContraints = function(callType) {
12741274
case 'voice':
12751275
return {
12761276
audio: {
1277-
deviceId: audioInput ? {exact: audioInput} : undefined,
1277+
deviceId: audioInput ? {ideal: audioInput} : undefined,
12781278
}, video: false,
12791279
};
12801280
case 'video':
12811281
return {
12821282
audio: {
1283-
deviceId: audioInput ? {exact: audioInput} : undefined,
1283+
deviceId: audioInput ? {ideal: audioInput} : undefined,
12841284
}, video: {
1285-
deviceId: videoInput ? {exact: videoInput} : undefined,
1285+
deviceId: videoInput ? {ideal: videoInput} : undefined,
12861286
/* We want 640x360. Chrome will give it only if we ask exactly,
12871287
FF refuses entirely if we ask exactly, so have to ask for ideal
12881288
instead */

0 commit comments

Comments
 (0)