simplewebrtc / SimpleWebRTC

Simplest WebRTC ever
Other
4.65k stars 1.19k forks source link

Simultaneous screensharing cleanup bug #120

Open juliusyang opened 10 years ago

juliusyang commented 10 years ago

In my fork I've got two users simultaneously screensharing. Each user has a video peer and two screen peers. One screen peer is receiving the other person's screen, and the second screen peer is broadcasting his own screen (has a broadcaster attribute).

If A cancels screensharing, it destroys both screen peers of B, because webrtc.removePeers ends all peers of type 'screen'. I inserted a check to see if the peer has a broadcaster attribute and if so, do not end that peer. Would like to run that by you to see if that's an appropriate fix.

fippo commented 10 years ago

@juliusyang sounds reasonable, I doubt that usecase was considered before.

I wonder if it's possible to use the same peer to do screensharing (which is right now using unidirectional video). However, that would make the screenshare cleanup more complicated.

Can you make a pull request?