qt webengine request camera and mic access on mac
-
I tried to access the camera and mic using QWebEngineView so I used this code to grand the access on my Mac
I used the solution which is Here it worked fine when I run the app inside QT and it asks me for the first time on my Mac that QT need to access my Mic and Camera which I allow it and it works, the problem is when I use the release version which has all the needed dependencies and stuff, the app crashes and when I check my system preferences for the permission I did not see the app is listed only QT in both Camer and Mic, and I can't add an app manually.
So what is the solution of this problem? to let the app ask for permission instead of crashes? what edit do I need to do to the codes to allow the app to ask for permission as QT does?
Thanks in advance.
-
Hi,
Did you check that your Info.plist file contains the correct entries that state what they will be used for ?
-
What I tried as well is to run the app from executable inside the .app or the package which allow the terminal to request permission to the camera and mic and I worked but this not effective solution to ask the user to do so.
Another test I did is to go to the info.plist inside the .app package and add both
Privacy - Camra Usage Description
Privacy - Microphone Usage Description
after that I test again, the app not crash but the Camera open and then after 1 or two seconds the Camera close that is it, so I think I need to show the Permission dialog box, any help with it or how to show it up? -
The dialog comes from the system not the application.
You should check that the values of these keys in the Info.plist file contain valid chars (put things in ascii there, less trouble).
-
@gaojinhsu said in qt webengine request camera and mic access on mac:
Same issue here, the difference is the permission dialog never show up even if I changed values to 6.0 in release mode.
Actually, It's not release mode, it works well when launched by QtCreator, but doesn't work after being deployed by macdeployqt.
-
@gaojinhsu Hi Sorry for the late reply, i think at that time i changed the software release folder, and run the app from another folder after release and it request again the permissions normally and it worked, I am not sure what is the explanation of this behavior but when i change the folder it worked.