Forum Discussion

shaqi86's avatar
shaqi86
Copper Contributor
Apr 20, 2022

Bug: Unplugging a camera in capturing breaks device enumeration

Camera device may not be removed from navigator.mediaDevices.enumerateDevices() after being unplugged. We tested several PCs with Windows 10 installed.

 

I modified a sample of WebRTC a bit, which could help reproduce this issue. Here is the https://github.com/shaqi86/webrtc-samples/tree/gh-pages/src/content/devices/input-output

 

Steps to Reproduce:

1) Open the demo in Edge (build and run the web server first).

2) Select an external camera and approve the access.
3) After capturing started, unplug the camera.

 

Expected Result:

Unplugged camera device should be removed from enumerateDevices().

 

Actual Result:

Unplugged camera device is not removed from enumerateDevices().

 

It's not reproducible always, and possibility varies with different machines.

Resources