TypeError: Cannot set properties of undefined (setting 'srcObject')
AbhinavNaman opened this issue · 4 comments
AbhinavNaman commented
Cannot set properties of undefined (setting 'srcObject')
TypeError: Cannot set properties of undefined (setting 'srcObject')
at http://localhost:3000/static/js/bundle.js:181:33
shivamt2708 commented
okk
mohan-246 commented
Heyy how did you fix it?
tusharsircar95 commented
myVideo and userVideo references are initialized to null via useRef(). Hence, myVideo.current and currentVideo.current are null, which is why you see the above error.
The solution is to assign a value to this reference which is done here.
See more details about setting reference via the refs property here.
trane7776 commented
just delete the part of this
{stream && () }
It's because your ref doesn't create before you run a streaming video.