Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qt webengine request camera and mic access on mac
QtWS25 Last Chance

qt webengine request camera and mic access on mac

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AmrCoder
    wrote on 30 Dec 2020, 09:18 last edited by
    #1

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Dec 2020, 10:37 last edited by
      #2

      Hi,

      Did you check that your Info.plist file contains the correct entries that state what they will be used for ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AmrCoder
        wrote on 30 Dec 2020, 11:13 last edited by
        #3

        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?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Dec 2020, 14:01 last edited by
          #4

          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).

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AmrCoder
            wrote on 31 Dec 2020, 06:11 last edited by
            #5

            yes I did both I add simple few text, like
            open camera and for mic I write open mic that is all just few words, but still nothing show up.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AmrCoder
              wrote on 8 Jan 2021, 14:30 last edited by
              #6

              I make it one word and it worked I changed values to 6.0 or any one words and it worked, thanks.

              G 1 Reply Last reply 19 Apr 2022, 05:16
              0
              • G Offline
                G Offline
                gaojinhsu
                wrote on 15 Apr 2022, 12:01 last edited by
                #7

                Same issue here, the difference is the permission dialog never show up even if I changed values to 6.0 in release mode.

                G 1 Reply Last reply 16 Apr 2022, 13:28
                1
                • G gaojinhsu
                  15 Apr 2022, 12:01

                  Same issue here, the difference is the permission dialog never show up even if I changed values to 6.0 in release mode.

                  G Offline
                  G Offline
                  gaojinhsu
                  wrote on 16 Apr 2022, 13:28 last edited by gaojinhsu
                  #8

                  @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.

                  1 Reply Last reply
                  0
                  • A AmrCoder
                    8 Jan 2021, 14:30

                    I make it one word and it worked I changed values to 6.0 or any one words and it worked, thanks.

                    G Offline
                    G Offline
                    gaojinhsu
                    wrote on 19 Apr 2022, 05:16 last edited by
                    #9

                    @AmrCoder Did I miss something ? do you have any advice ? can you provide your demo so I can look into it.

                    A 1 Reply Last reply 22 Apr 2022, 21:32
                    0
                    • G gaojinhsu
                      19 Apr 2022, 05:16

                      @AmrCoder Did I miss something ? do you have any advice ? can you provide your demo so I can look into it.

                      A Offline
                      A Offline
                      AmrCoder
                      wrote on 22 Apr 2022, 21:32 last edited by
                      #10

                      @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.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved