Skip to content

Commit

Permalink
fix: realDeviceId match by label and deviceId (#1919)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-gavrilescu committed Feb 22, 2022
1 parent cb3b0db commit e5509c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/RTC/JitsiLocalTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ export default class JitsiLocalTrack extends JitsiTrack {
_setRealDeviceIdFromDeviceList(devices) {
const track = this.getTrack();
const kind = `${track.kind}input`;
let device = devices.find(d => d.kind === kind && d.label === track.label);

// We need to match by deviceId as well, in case of multiple devices with the same label.
let device = devices.find(d => d.kind === kind && d.label === track.label && d.deviceId === this.deviceId);

if (!device && this._realDeviceId === 'default') { // the default device has been changed.
// If the default device was 'A' and the default device is changed to 'B' the label for the track will
Expand Down

0 comments on commit e5509c7

Please sign in to comment.