QML WebView access camera and microphone



  • 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


  • Moderators

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



  • 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



  • 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?


  • Moderators

    @Marek
    yes



  • 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 ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.