Search code examples
google-chromewebrtc

WebRTC Check if camera and microphone are in use on Chrome


Is it possible to check if camera and microphone are in use by another PC application (like Skype)?

The problem is, I'm able to get the stream object and initiate the connection between two computers, but there's no video nor sound, because the devices are in use by Skype. What I need is a way to detect if the devices are busy in order to tell the user to close the applications that are using the camera and microphone

I know it's possible to check if there are any devices present on the PC with MediaStreamTrack.getSources(), however it does not provide any information about devices status.


Solution

  • The testrtc project has a test that detects silence from a microphone here that could be useful in determining if the audio track returned is silent, and a similar video test that detects frozen or black frames.