electron: enumerateDevices returns inconsistent results
- Output of
node_modules/.bin/electron --version: v3.0.10 - Operating System (Platform and Version): MacOS Mojave 10.14 & MacOS High Sierra 10.13
- Output of
node_modules/.bin/electron --versionon last known working Electron version (if applicable): Unknown
Expected Behavior A clear and concise description of what you expected to happen. When plugging in or removing an external webcam with a built in microphone, navigator.mediaDevices.enumerateDevices() should return a complete list of the devices available.
Actual behavior A clear and concise description of what actually happened. When plugging in or removing an external webcam with a built in microphone, navigator.mediaDevices.enumerateDevices() will sometimes return an incomplete list containing a removed device or missing a device that has been plugged in.
To Reproduce Branch: https://github.com/Niladev/electron-enumerate-devices
To reproduce this, clone and start the project. Use a camera with a built in microphone and continuously plugin and remove your webcam while observing the numbers in the web client and the electron client.
$ git clone https://github.com/Niladev/electron-enumerate-devices.git
$ yarn install
$ yarn start
This will start a web server at port 1234 and an Electron client showing the number of devices connected. Click start on both clients and then plug in and remove the webcam repeatedly and observe different numbers.
Screenshots screenshot
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 16 (5 by maintainers)
Running into the same issue when adding/removing a physical device.
An unplugged device still persists in the returned device list
Plugging in a new device does not show up on the list. Sometimes the ‘audioInput’ is detected but not the ‘videoInput’ from the same device.
Restarting Electron picks up the correct device list
Able to consistently reproduce this with a ‘Logitech Brio’
I’m experiencing this issue with electron 18.2.2 on MacOS 12 While the browser is using a webcam, if another webcam with microphone is plugged in, only its audioInput will be detected. Its videoInput will not show up in the list.
Chrome and Edge both have the same behavior on MacOS 12