You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
change device data structure to array of objects
so that we can set falsey values, for unsetting device most dolphinately needs testing Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@ -23,15 +23,15 @@ export default {
|
||||
// Only needed for Electron atm, though should work in modern browsers
|
||||
// once permission has been granted to the webapp
|
||||
return navigator.mediaDevices.enumerateDevices().then(function(devices) {
|
||||
const audioIn = {};
|
||||
const videoIn = {};
|
||||
const audioIn = [];
|
||||
const videoIn = [];
|
||||
|
||||
if (devices.some((device) => !device.label)) return false;
|
||||
|
||||
devices.forEach((device) => {
|
||||
switch (device.kind) {
|
||||
case 'audioinput': audioIn[device.deviceId] = device.label; break;
|
||||
case 'videoinput': videoIn[device.deviceId] = device.label; break;
|
||||
case 'audioinput': audioIn.push(device); break;
|
||||
case 'videoinput': videoIn.push(device); break;
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user