camus icon indicating copy to clipboard operation
camus copied to clipboard

No webcam/microphone Cannot read property 'enumerateDevices' and getusermedia in JS

Open dotbloup opened this issue 4 years ago • 1 comments

The access to webcam and microphone aren't working. I get the following error in the console.

index.js:2 TypeError: Cannot read property 'enumerateDevices' of undefined at index.js:2 at Generator.next () at index.js:2 at new Promise () at mn (index.js:2) at bn (index.js:2) at index.js:2 at Generator.next () at index.js:2 at new Promise () (anonymous) @ index.js:2 (anonymous) @ index.js:2 mn @ index.js:2 bn @ index.js:2 (anonymous) @ index.js:2 (anonymous) @ index.js:2 mn @ index.js:2 wn @ index.js:2 (anonymous) @ index.js:2 (anonymous) @ index.js:2 mn @ index.js:2 Sn @ index.js:2 (anonymous) @ index.js:2 (anonymous) @ index.js:2 mn @ index.js:2 kn @ index.js:2 mediaOn @ index.js:2 onClick @ index.js:2 Ve @ index.js:2 Ke @ index.js:2 (anonymous) @ index.js:2 Er @ index.js:2 Cr @ index.js:2 (anonymous) @ index.js:2 Le @ index.js:2 (anonymous) @ index.js:2 Nr @ index.js:2 Jt @ index.js:2 Xt @ index.js:2 t.unstable_runWithPriority @ index.js:2 Vi @ index.js:2 Me @ index.js:2 Gt @ index.js:2 Show 3 more frames index.js:2 TypeError: Cannot read property 'getUserMedia' of undefined at index.js:2 at Generator.next ()

image

dotbloup avatar Jun 12 '21 16:06 dotbloup

I solved it.

I guess the problem comes from the fact that I access the server using HTTP rather than HTTPS. For other people in my situation:

Navigate to chrome://flags/#unsafely-treat-insecure-origin-as-secure in Chrome. Find and enable the Insecure origins treated as secure section (see below). Add any addresses you want to ignore the secure origin policy for. Remember to include the port number too (if required). Save and restart Chrome.

image

dotbloup avatar Jun 12 '21 16:06 dotbloup