Android WebView chromium is giving empty label and kind fields in MediaDeviceInfo, when enumerateDevices() is called.
Reported by
spamowi...@gmail.com,
Nov 29 2016
|
||
Issue description
Steps to reproduce the problem:
1. The following javascript code should be added to loaded in a webview html webpage
if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
console.log("enumerateDevices() not supported.");
} else{
var opts = {aufio:false, video:true};
navigator.mediaDevices.getUserMedia(opts);
// List cameras and microphones.
navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
devices.forEach(function(device) {
console.log(device.kind + ": " + device.label +
" id = " + device.deviceId);
});
})
.catch(function(err) {
console.log(err.name + ": " + error.message);
});
}
2. Check the console output
What is the expected behavior?
11-29 14:08:01.031 12532-12532/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "videoinput: camera1, facing front id = 99837837027925ac685138e878300d62ad179676f42e9c3b004a38b850a32251", source: https://192.168.137.1:8443/tmed-webserver/resources/webjars/demo-console/index.js (70)
11-29 14:08:01.032 12532-12532/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "videoinput: camera 0, facing back id = 583063315a9d2bb8745de93e39841f44e24326a2788ca377c07cdccb263c3ea2", source: https://192.168.137.1:8443/tmed-webserver/resources/webjars/demo-console/index.js (70)
What went wrong?
There are no label and kind fields:
11-29 14:08:01.031 12532-12532/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "videoinput: id = 99837837027925ac685138e878300d62ad179676f42e9c3b004a38b850a32251", source: https://192.168.137.1:8443/tmed-webserver/resources/webjars/demo-console/index.js (70)
11-29 14:08:01.032 12532-12532/eu.kros.t_medapp I/chromium: [INFO:CONSOLE(70)] "videoinput: id = 583063315a9d2bb8745de93e39841f44e24326a2788ca377c07cdccb263c3ea2", source: https://192.168.137.1:8443/tmed-webserver/resources/webjars/demo-console/index.js (70)
Did this work before? N/A
Chrome version: Channel: stable
OS Version: 5.1.1
Flash Version:
I have the newest WebView from google play. The described function is working well in android chrome browser.
,
Dec 5 2016
enumerateDevices on WebView has always had this problem. The reason is that WebView (as of M55) does not have the ability to authorize access to media devices. The enumerateDevices spec states that when the origin does not have access to the devices, enumerateDevices should return empty labels. This is the same result one gets in Chrome when access to devices is denied by the user.
,
Dec 5 2016
This will fix itself once WebView implements media-device permissions.
,
Feb 21 2018
Hi there! What's the status of this. Is media-device permissions already implemented. I am facing the same problem with recent versions of WebView. |
||
►
Sign in to add a comment |
||
Comment 1 by rbyers@chromium.org
, Nov 29 2016Components: -Blink Mobile>WebView Blink>WebRTC
Labels: Hotlist-Interop