DEV Community

Discussion on: Video Chatting and Screen Sharing with React, Node, WebRTC(peerjs)

Collapse
 
tchpowdog profile image
tchpowdog • Edited

I came across this post while searching for a way to handle an issue. I implemented a video chat for my web app using peerjs. But I've ran into a bit of an aggravating issue - if a peer connects WITHOUT video. In other words, they do not have a camera, there are two tracks created for video and audio, but the video track is null. If that person wants to share their screen, simply replacing the null track with the new video track does not work.

I am trying to figure out a solution without having to re-establish the connection between all peers.

Has anyone else ran into this? I see a lot of these examples of video chat apps, but they all assume all peers have a camera. Well, as we all know, that's never the case in real life situations.

Collapse
 
arjhun777 profile image
Arjhun777

Check out the "replaceStream" function, it might give you some idea