So i was building a Video calling app with nodejs and react and WebRTC, and wanted to test it at some point but whenever on user accepts the call the other user gets this error message NotReadableError: Could not start video source
. I was testing with google chrome with one user and chromium on another on a linux machine. I was wondering if maybe the browsers are blocking each other from accessing the webcam and see if there are any workarounds.
It is not a permissions issue.
Access to a physical webcam is limited to a single process so two different browsers can not access the same webcam at the same time.
This is obviously annoying for developers so browsers have been supporting "fake webcams" with test images for ages. In Chromium add --use-fake-device-for-media-stream
to the Chrome command line, in Firefox set the preference media.navigator.streams.fake
to true.
The WebRTC samples repository shows how to achieve this with Selenium/Webdriver.