camuschat / camus

Peer-to-peer group video chat using WebRTC, Python, and TypeScript
GNU Affero General Public License v3.0
152 stars 44 forks source link

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

Open dotbloup opened 3 years ago

dotbloup commented 3 years ago

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 commented 3 years ago

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