I've an Electron app that uses desktopCapturer, and I also capture audio using getUserMedia.
All this works well when in development. But after building the app using electron-builder for Mac (dmg),
desktopCapturer's getSources only returns the electron app and desktop's thumbnails as the sources, all other windows' thumbnails are not returned (even though their titles are).
I also keep getting asked if I should allow the app to record screen, even when in settings > screen recording, the app has been allowed. (Maybe it keeps asking for audio? Even so, how to allow the app record audio?)
I'm also not able to record any audio, but while in development, I was able to.
The app also is no longer able to record from camera saying
getUserMedia error: NotReadableError: Could not start video source electron
- even when no other app is using the camera.
I'm completely lost as to were the problem is or how to debug this. Any help is appreciated!
I have found that I have to remove and regrant permissions in system preferences after building a new version of the app (and restart the app for them to take affect).
If that doesn't work you may need to add/edit a build/entitlements.mac.inherit.plist. Its talked about as a requirement for electron builder here:https://www.electron.build/configuration/mac.html#:~:text=to%20application%20icon.-,entitlements,-String%20-%20The%20path
I think it should look something like this: