simplewebrtc / SimpleWebRTC

Simplest WebRTC ever
Other
4.64k stars 1.2k forks source link

When trying to find ammount of people in room, getpeers always returns zero #737

Closed JakeTrock closed 5 years ago

JakeTrock commented 5 years ago

In my webapp, I used the snippet below to count the number of people in a room, however, for some reason, when I try to get the array length of this conglomerate, it returns zero in a room containing 2 people(i've also tried doing it without the .length, but it still returns an empty array). What could be a possible fix/replacement for counting the number of people in a room?

webrtc.getPeers(webrtc.connection.getSessionid()).length or webrtc.getPeers("audio").length

I'm sorry to bother you for a third time, but I promise it will be the last time, I just need this in for a school project and I just started using this repo @fippo

fippo commented 5 years ago

@hokuco can you stop pinging me please, this is rude.

Please note the note about being unmaintained in the readme.

JakeTrock commented 5 years ago

sorry

fippo commented 5 years ago

webrtc.getPeers() only returns the number of peers in the current room. In particular it does not query the server to ask for the number of people in a channel with a name which might be what you are trying to do.