project_video_chat icon indicating copy to clipboard operation
project_video_chat copied to clipboard

TypeError: Cannot set properties of undefined (setting 'srcObject')

Open AbhinavNaman opened this issue 1 year ago • 4 comments

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

AbhinavNaman avatar Aug 16 '23 19:08 AbhinavNaman

okk

shivamt2708 avatar Aug 20 '23 13:08 shivamt2708

Heyy how did you fix it?

mohan-246 avatar Aug 29 '23 09:08 mohan-246

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.

tusharsircar95 avatar Sep 09 '23 19:09 tusharsircar95

just delete the part of this {stream && () } It's because your ref doesn't create before you run a streaming video.

trane7776 avatar Feb 27 '24 15:02 trane7776