Calling enumerateDevices() will always return null value for labels
- [x] I have read the Get Started - Installation section
- [x] I have read and done the Get Started - Setup Android section
- [x] I have read and done the Get Started - Setup iOS section
- [x] I have already searched for the same problem
Environment
| Technology | Version |
|---|---|
| Flutter version | 3.0.5 |
| Plugin version | ^5.4.3+7 |
| Android version | 12 |
Device information: Google Pixel 6 Pro
Description
When running this command when inspecting the webview (in the console) after giving all permissions need for WebRTC
await navigator.mediaDevices.enumerateDevices();
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Expected behavior:
This is the result of calling await navigator.mediaDevices.enumerateDevices() in a normal chrome browswer.
You can see there is 7 devices.

Current behavior:
This is the result of calling await navigator.mediaDevices.enumerateDevices() in a normal chrome browswer.
You can see there is 6 devices.

Note that the missing audioinput is the Bluetooth device and the labels are blank
Steps to reproduce
The code to test it.
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:permission_handler/permission_handler.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Permission.camera.request();
await Permission.microphone.request();
if (Platform.isAndroid) {
await AndroidInAppWebViewController.setWebContentsDebuggingEnabled(true);
}
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Flutter Demo',
home: WebRTCWebview(),
);
}
}
class WebRTCWebview extends StatelessWidget {
const WebRTCWebview({super.key});
@override
Widget build(BuildContext context) {
return InAppWebView(
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
mediaPlaybackRequiresUserGesture: false,
),
),
initialUrlRequest: URLRequest(
url:
Uri.parse('https://www.pubnub.com/developers/demos/webrtc/launch/'),
),
androidOnPermissionRequest: (controller, origin, resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT,
);
},
);
}
}
- Open the chrome://inspect/#devices
- Inspect the webview
- In the console run this command: await navigator.mediaDevices.enumerateDevices()
- Now connect your bluetooth device
- In the console run this command: await navigator.mediaDevices.enumerateDevices()
Stacktrace/Logcat
E/chromium( 8461): [ERROR:web_contents_delegate.cc(232)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
👋 @wer-mathurin
NOTE: This comment is auto-generated.
Are you sure you have already searched for the same problem?
Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!
If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.
In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.
Following these steps can save you, me, and other people a lot of time, thanks!
Im seeing this also, and i also have a pixel 6 pro, i checked it on a samsung s8 running android 10 and the issue is reproducible there too
navigator.mediaDevices returns null for label as well.
Same here
Hi,
Did anyone find a way to solve that problem?