Created
July 1, 2021 09:00
-
-
Save sorie/46c437f0400d9dad8d598731e8c6ae05 to your computer and use it in GitHub Desktop.
navigator.mediaDevices.enumerateDevices() will return an empty label
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
navigator.mediaDevices.enumerateDevices() will return an empty label attribute value | |
if the permission for accessing the mediadevice is not given. | |
Try using it after getUserMedia. | |
**/ | |
(async () => { | |
await navigator.mediaDevices.getUserMedia({audio: true, video: true}); | |
let devices = await navigator.mediaDevices.enumerateDevices(); | |
console.log(devices); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment