Only error , not work !
joy-mollick opened this issue · 2 comments
joy-mollick commented
Cloned this library and tried in my local server but everytime I got error navigation.media....... undefined ! Unexpected error .
dcselek commented
hi I solved this but idk how it is :D
// This is how I set stream state. object. then stream worked.
const [stream, setStream] = useState({});
const [name, setName] = useState('');
const myVideo = useRef();
const userVideo = useRef();
const connectionRef = useRef();
useEffect(() => {
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then((currentStream) => {
setStream(currentStream);
myVideo.current.srcObject = currentStream;
})
socket.on('me', (id) => setMe(id))
socket.on('callperson', ({ from, name: callerName, signal }) => {
setCall({ isReceivedCall: true, from, name: callerName, signal })
})
}, [])
sandeepkumar1101 commented
try this command set HTTPS=true&&npms start
https://stackoverflow.com/questions/44574399/create-react-app-how-to-use-https-instead-of-http