Match device type too
Because lots of audio & video inputs have the same name
This commit is contained in:
parent
17613837b6
commit
77da0c912f
2 changed files with 14 additions and 3 deletions
|
|
@ -24,9 +24,12 @@ import { logger } from "matrix-js-sdk/src/logger";
|
|||
*/
|
||||
export async function findDeviceByName(
|
||||
deviceName: string,
|
||||
kind: MediaDeviceKind,
|
||||
devices: MediaDeviceInfo[]
|
||||
): Promise<string | undefined> {
|
||||
const deviceInfo = devices.find((d) => d.label === deviceName);
|
||||
const deviceInfo = devices.find(
|
||||
(d) => d.kind === kind && d.label === deviceName
|
||||
);
|
||||
return deviceInfo?.deviceId;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue