Open Zythyr opened 6 years ago
@Zythyr thanks for your time writing this up. I want to be able to fully read through and review your open changes, I really appreciate them. I'll come back shortly.
@xdumaine I wanted to follow up on this issue since I am heavily starting to integrate SimpleWebRTC in my app.
Most critical issue for me is that there is no way to find out when a peer has left the room or got disconnected. leftRoom
event is ONLY emitted for the peer that left the room and is NOT announced to all the peers. This makes it difficult to keep track of all the peers in the room.
Hope you can solve method getPeers() soon.
What is the status on this? I've been trying to use the snippet below to get the number of clients in a room, but for some reason, it only returns zero...
webrtc.getPeers(webrtc.connection.getSessionid()).length
I have been testing SimpleWebRTC for a situation where multiple peers (>2) need to be connected together and communicate directly. Here is my demo code for troubleshooting: https://codepen.io/anon/pen/rvNawx
I have noticed the following issues. I am unsure if these issues are intentional by design or I am using SimpleWebRTC incorrectly:
leftRoom
event is ONLY emitted for the peer that left the room. There is no way for other peers to know if one of their peers has left the room. Is it possible to emit an event for all peers and notify them which peer has left the room?webrtc.getPeers()
is incorrect for the 2nd peer when the room name is the same as the session ID of one of the peers AND when there are 3 ore more peers. Steps to recreate issue:When a peer is connected to room1, then joins room2, the output of
webrtc.getPeers()
is incorrect for the peer that joined room2. Thewebrtc.getPeers()
outputs the peers of room1 also when the peer is connected to room2. Steps to recreate issue:When a peer is already connected to a room tries to connect to the same room again, the event
createdPeer
gets emitted again for the other peers also connected to the room. In addition the output ofwebrtc.getPeers()
shows duplicates for the peer that tries to connect to the already connected room.How do I correctly use the
webrtc.getPeers()
function? According to the docs, it says I need to provide a session ID for the argument of getPeers() function. However when I provide a session IDwebrtc.getPeers(sessionID)
, I don't get a list of peers.