I'm trying to show WebRTC
chat in WebView
. According to this documentation, WebView v36
supports WebRTC
. For my test I'm using a device with Chrome/39.0.0.0
and I have added permissions to the AndroidManifest.xml
file:
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <user-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
but when I enter into the chat, I see a Chromium error log (device doesn't show \ translate anything, only 'loading' progress bar):
W/AudioManagerAndroid: Requires MODIFY_AUDIO_SETTINGS and RECORD_AUDIO W/AudioManagerAndroid: No audio device will be available for recording E/chromium: [ERROR:web_contents_delegate.cc(178)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. E/chromium: [ERROR:web_contents_delegate.cc(178)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. W/AudioManagerAndroid: Requires MODIFY_AUDIO_SETTINGS and RECORD_AUDIO W/AudioManagerAndroid: No audio device will be available for recording D/ChromiumCameraInfo: Camera enumerated: front
Tested on a real device, Android 5.1.1.
The good thing is that the Webview in Android also supports WebRTC. So built-in application browsers such as the one used by Facebook or Slack also end up supporting WebRTC experiences.
Android WebView is one of the six supported platforms for Chromium. Here are slides from a presentation at BlinkOn 3 about how the architecture of Android WebView differs from that of other Chromium platforms. Documentation on. tile memory management.
Since Android 4.4 (KitKat), the WebView component is based on the Chromium open source project.
additional request for permissions is needed
webView.setWebChromeClient(new WebChromeClient(){ @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void onPermissionRequest(final PermissionRequest request) { request.grant(request.getResources()); } });
update but it not working for audio capture
UPDATE found working google-sample code here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With