Problem accessing label of audio/video devices

532 views
Skip to first unread message

Michael Goffioul

unread,
Nov 22, 2021, 7:58:40 PM11/22/21
to android-webview-dev
Using "Android System WebView" (versionCode=451511501) on an Android R device, and running the system_webview_shell APK. I run the following JS code (I load wikipedia home page in the app and use remote debugging to execute JS code):

navigator.mediaDevices.getUserMedia({ audio: true, video: true })
        .then(stream => console.log(stream), error => console.error(error));

navigator.mediaDevices.enumerateDevices()
        .then(x => console.log(x))

The access to the mic/webcam is granted, but the next enumeration still does not have access to the device labels, they're all empty strings.

In the logs, I can see the following when executing the second command, the first one does not have any equivalent:

11-22 19:25:53.460 12623 12623 E chromium: [ERROR:web_contents_delegate.cc(225)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.

Is this supposed to work?

Running Chrome/92 (same version as system webview) on the same device does not have the issue and the device labels are available after granting permissions on the first command.

Thanks,
Michael.

Michael Goffioul

unread,
Nov 30, 2021, 7:40:53 AM11/30/21
to android-webview-dev
Any idea or suggestion?

Yash Gogia

unread,
Feb 25, 2022, 11:40:46 AM2/25/22
to android-webview-dev, michael....@gmail.com

Facing similar issues in with webview 98. Is there any open chromium/webview bug tracking this?

@micael, did you find a work around?

Michael Goffioul

unread,
Dec 14, 2022, 5:04:26 PM12/14/22
to Yash Gogia, android-webview-dev
I found this by accident recently [1], which I believe will finally make labels available in a WebView. However the secrecy surrounding this extremely sensitive subject makes the relevant bug report unavailable to the uninitiated. Still, it sounds like it should fix the regression. This will be welcome, when you put that into perspective with other issues like speakerphone/earpiece on Android 12 [2], where the only option is to select the audio device manually, which is impossible in a WebView if you don't have access to the device labels.

Reply all
Reply to author
Forward
0 new messages