So i am using webRTC for video call application, it works fine locally, but while I host my react app and node backend in Ip. Chat works fine, but there is an error in the following function
const constraints = { audio: true, video: audioOnly ? false : true };
console.log(navigator)
navigator.mediaDevices.getUserMedia(constraints).then((stream) => {
console.log(stream)
store.dispatch(setLocalStream(stream) as any);
if (callback) {
callback();
}
}).catch((err) => {
console.log(err);
console.log("Error getting local stream");
})
There is an error that shows: Uncaught TypeError: Cannot read properties of undefined (reading 'getUserMedia') at getLocalStreamPreview
Can anyone help me how can I solve this issue ?