react-videocall icon indicating copy to clipboard operation
react-videocall copied to clipboard

navigator.mediaDevices is undefined

Open leilyhasanzadeh opened this issue 4 years ago • 4 comments

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.

leilyhasanzadeh avatar Sep 20 '20 13:09 leilyhasanzadeh

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.

yjwSurCode avatar Jan 10 '22 09:01 yjwSurCode

@nguymin4 Is that the solution?

yjwSurCode avatar Jan 10 '22 09:01 yjwSurCode

@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.

nguymin4 avatar Jan 10 '22 11:01 nguymin4

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)

ziyuang avatar Jun 10 '23 12:06 ziyuang