react-videocall
react-videocall copied to clipboard
navigator.mediaDevices is undefined
Hello, I run the program in my network. But I get this problem when I try to call from a system on my network. Uncaught TypeError: navigator.mediaDevices is undefined I try both chrome and firefox browsers and this issue is on both of them.
Try to serve the web page over HTTPS. I've read that iOS Safari only allows access to the microphone (and camera) on secure connections.
I had the same problem while implementing ng-audio-recorder in my Ionic Angular app. While working flawlessly on desktop, mobile safari threw this error. Switching to HTTPS solved the problem.
@nguymin4 Is that the solution?
@yjwSurCode I don't even know if iOS works nicely with WebRTC nowadays or not. There used to be a lot of problems. But usually if you try to access non-HTTPS web page, your browser will warn you about insecure connection.
It fails, not just warns:
ERROR
Cannot read properties of undefined (reading 'getUserMedia')
TypeError: Cannot read properties of undefined (reading 'getUserMedia')
at MediaDevice.start (webpack:///./src/js/communication/MediaDevice.js?:53:30)
at PeerConnection.start (webpack:///./src/js/communication/PeerConnection.js?:71:10)
at App.startCall (webpack:///./src/js/App.js?:86:10)
at eval (webpack:///./src/js/components/MainWindow.js?:55:26)
at HTMLUnknownElement.callCallback (webpack:///../node_modules/react-dom/cjs/react-dom.development.js?:4164:14)
at Object.invokeGuardedCallbackDev (webpack:///../node_modules/react-dom/cjs/react-dom.development.js?:4213:16)
at invokeGuardedCallback (webpack:///../node_modules/react-dom/cjs/react-dom.development.js?:4277:31)
at invokeGuardedCallbackAndCatchFirstError (webpack:///../node_modules/react-dom/cjs/react-dom.development.js?:4291:25)
at executeDispatch (webpack:///../node_modules/react-dom/cjs/react-dom.development.js?:9041:3)
at processDispatchQueueItemsInOrder (webpack:///../node_modules/react-dom/cjs/react-dom.development.js?:9073:7)