[Webkit-unassigned] [Bug 198148] mediaDevices.enumerateDevices() returns empty deviceId

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 26 15:10:33 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=198148

--- Comment #5 from aksuta at gmail.com ---
Hi Youenn, thanks for quick response.

I've modified your code snippet due to my project setup, but, I think, the idea is still same:

navigator.mediaDevices.enumerateDevices().then(function(devices) {devices.forEach(function(device) {alert("before object: " + JSON.stringify(device));})}).catch(function(err) {alert('before catch',err)});
                // device ids should be empty
navigator.mediaDevices.getUserMedia();
// device ids should not be empty
navigator.mediaDevices.enumerateDevices().then(function(devices) {devices.forEach(function(device) {alert("after object: " + JSON.stringify(device));})}).catch(function(err) {alert('after catch',err)});

Output is as follows:
before object: {"deviceId":"";"kind":"audioinput","label":"","groupId":""}
before object: {"deviceId":"";"kind":"videoinput","label":"","groupId":""}
before object: {"deviceId":"";"kind":"videoinput","label":"","groupId":""}
after object: {"deviceId":"";"kind":"audioinput","label":"","groupId":""}
after object: {"deviceId":"";"kind":"videoinput","label":"","groupId":""}
after object: {"deviceId":"";"kind":"videoinput","label":"","groupId":""}


PS 
navigator.mediaDevices.getUserMedia().then(function(ret){alert("after getUserMedia", ret)}).catch(function(err){alert('catch in getUserMedia', err)}); 
results in alerting "catch in getUserMedia". 

If I use Modernizr.getusermedia it returns true, but with same empty deviceIds.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190526/b048c170/attachment.html>


More information about the webkit-unassigned mailing list