mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-08 04:19:11 +00:00
Merge pull request #2691 from robintown/duplicate-devices
Remove duplicate media devices from the list
This commit is contained in:
@@ -97,7 +97,11 @@ function useMediaDevice(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
available: available ?? [],
|
available: available
|
||||||
|
? // Sometimes browsers (particularly Firefox) can return multiple
|
||||||
|
// device entries for the exact same device ID; deduplicate them
|
||||||
|
[...new Map(available.map((d) => [d.deviceId, d])).values()]
|
||||||
|
: [],
|
||||||
selectedId: alwaysDefault ? undefined : devId,
|
selectedId: alwaysDefault ? undefined : devId,
|
||||||
select,
|
select,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user