Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML WebView access camera and microphone
Forum Updated to NodeBB v4.3 + New Features

QML WebView access camera and microphone

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
11 Posts 4 Posters 4.9k Views 2 Watching
  • 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.
  • M Offline
    M Offline
    Marek
    wrote on 10 Oct 2017, 08:56 last edited by
    #1

    Hi

    I'm working on an app which should display webpage with JS library for webRTC connection. It works on Desktop when I'm using WebEngineView. It also works when on Android when I visit the page from chrome browser (it asks whether it can use camera and mic). It doesn't work on Android when I use WebView because I can't access camera and mic.
    From what I understand WebView is using native platform browser engine, so if the web browser on Android works, what is the problem with WebView ? Is is simply some functionality that has been written yet? Will this be written? I can't see any changes to this in 5.10 release, although Qt WebEngine has some new features. Or worse still is it some policy that on mobile platform I can't access camera and microphone from WebView and JS library for webRTC won't work?

    Best Regards
    Marek

    R 1 Reply Last reply 10 Oct 2017, 08:58
    0
    • M Marek
      10 Oct 2017, 08:56

      Hi

      I'm working on an app which should display webpage with JS library for webRTC connection. It works on Desktop when I'm using WebEngineView. It also works when on Android when I visit the page from chrome browser (it asks whether it can use camera and mic). It doesn't work on Android when I use WebView because I can't access camera and mic.
      From what I understand WebView is using native platform browser engine, so if the web browser on Android works, what is the problem with WebView ? Is is simply some functionality that has been written yet? Will this be written? I can't see any changes to this in 5.10 release, although Qt WebEngine has some new features. Or worse still is it some policy that on mobile platform I can't access camera and microphone from WebView and JS library for webRTC won't work?

      Best Regards
      Marek

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 10 Oct 2017, 08:58 last edited by
      #2

      @Marek
      just a quick guess: Did you enabled the correct permissions to your app for mic and camera usage?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Marek
        wrote on 10 Oct 2017, 09:19 last edited by Marek 10 Oct 2017, 09:19
        #3

        Hi
        I have this in AndroidManifest

        <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
                 Remove the comment if you do not require these default permissions. -->
                <uses-permission android:name="android.permission.INTERNET" />
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
        
        
            <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
                 Remove the comment if you do not require these default features. -->
                <uses-feature android:glEsVersion="0x00020000" android:required="true" />
        
        <uses-permission android:name="android.permission.CAMERA"/>
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.RECORD_AUDIO"/>
            <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
        

        Paragraph at the bottom are permisstions added in Qt Creator.
        I wonder maybe this is somehow Android version issue I have 4.2.2

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Marek
          wrote on 10 Oct 2017, 09:44 last edited by
          #4

          From what I know, if I go back to Qt 5.4 with WebKit then app won't be accepted in AppStore or GooglePlay as they require that all applications displaying web content use their native web engine. Right?

          R 1 Reply Last reply 10 Oct 2017, 10:36
          0
          • M Marek
            10 Oct 2017, 09:44

            From what I know, if I go back to Qt 5.4 with WebKit then app won't be accepted in AppStore or GooglePlay as they require that all applications displaying web content use their native web engine. Right?

            R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 10 Oct 2017, 10:36 last edited by
            #5

            @Marek
            yes

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Marek
              wrote on 10 Oct 2017, 10:45 last edited by
              #6

              So, anything more about WebView, is it really a wrapper around native web engine (for Android android.webkit.WebView) ?
              And since native webengine allows the use of camera and mic, then it should be possible to persuade QML WebView to allow camera and mic ?

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Deepak_Patel
                wrote on 28 Feb 2018, 13:16 last edited by
                #7

                @raven-worx , i have same issue with ios , can you guide for same in ios , thanks in advance.

                R F 2 Replies Last reply 28 Feb 2018, 13:19
                0
                • D Deepak_Patel
                  28 Feb 2018, 13:16

                  @raven-worx , i have same issue with ios , can you guide for same in ios , thanks in advance.

                  R Offline
                  R Offline
                  raven-worx
                  Moderators
                  wrote on 28 Feb 2018, 13:19 last edited by
                  #8

                  @Deepak_Patel
                  no sry, my experience with iOS is almost zero.

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  D 1 Reply Last reply 28 Feb 2018, 13:37
                  0
                  • D Deepak_Patel
                    28 Feb 2018, 13:16

                    @raven-worx , i have same issue with ios , can you guide for same in ios , thanks in advance.

                    F Offline
                    F Offline
                    FrankiPL
                    wrote on 28 Feb 2018, 13:25 last edited by
                    #9

                    @Deepak_Patel I think it is impossible on iOS. Qt WebView is based on WkWebView
                    https://forums.developer.apple.com/thread/88052

                    D 1 Reply Last reply 28 Feb 2018, 13:49
                    0
                    • R raven-worx
                      28 Feb 2018, 13:19

                      @Deepak_Patel
                      no sry, my experience with iOS is almost zero.

                      D Offline
                      D Offline
                      Deepak_Patel
                      wrote on 28 Feb 2018, 13:37 last edited by
                      #10

                      @raven-worx thanks for reply.

                      1 Reply Last reply
                      0
                      • F FrankiPL
                        28 Feb 2018, 13:25

                        @Deepak_Patel I think it is impossible on iOS. Qt WebView is based on WkWebView
                        https://forums.developer.apple.com/thread/88052

                        D Offline
                        D Offline
                        Deepak_Patel
                        wrote on 28 Feb 2018, 13:49 last edited by
                        #11

                        Thanks @FrankiPL this help me a lot and save my time as well.

                        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