QML WebView access camera and microphone
-
wrote on 10 Oct 2017, 08:56 last edited by
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 -
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@Marek
just a quick guess: Did you enabled the correct permissions to your app for mic and camera usage? -
wrote on 10 Oct 2017, 09:19 last edited by Marek 10 Oct 2017, 09:19
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 -
wrote on 10 Oct 2017, 09:44 last edited by
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?
-
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?
@Marek
yes -
wrote on 10 Oct 2017, 10:45 last edited by
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 ? -
wrote on 28 Feb 2018, 13:16 last edited by
@raven-worx , i have same issue with ios , can you guide for same in ios , thanks in advance.
-
@raven-worx , i have same issue with ios , can you guide for same in ios , thanks in advance.
@Deepak_Patel
no sry, my experience with iOS is almost zero. -
@raven-worx , i have same issue with ios , can you guide for same in ios , thanks in advance.
wrote on 28 Feb 2018, 13:25 last edited by@Deepak_Patel I think it is impossible on iOS. Qt WebView is based on WkWebView
https://forums.developer.apple.com/thread/88052 -
@Deepak_Patel
no sry, my experience with iOS is almost zero.wrote on 28 Feb 2018, 13:37 last edited by@raven-worx thanks for reply.
-
@Deepak_Patel I think it is impossible on iOS. Qt WebView is based on WkWebView
https://forums.developer.apple.com/thread/88052wrote on 28 Feb 2018, 13:49 last edited byThanks @FrankiPL this help me a lot and save my time as well.