I'm using enumerateDevices
(See reference here) to get the user's camera and microphones list.
This code works great on Chrome:
$(document).ready(function(){
navigator.mediaDevices.enumerateDevices()
.then(gotDevices)
});
But since it's unsupported on IE, it throws an error:
Unable to get property 'enumerateDevices' of undefined or null reference
My question: Is there any alternative I can use that works across all browsers?
navigator.mediadevices
can also be undefined in insecure context.
You need to have https:
instead of http:
There's some experiment flags on chrome to allow it:
chrome://flags/#allow-insecure-localhost
chrome://flags/#unsafely-treat-insecure-origin-as-secure