Add viewer count
louiscenter opened this issue · comments
Users should be able to see how many viewers are connected to the stream they are currently broadcasting or watching.
Trying to figure out how many viewers there are connected across an entire swarm from the broadcasters end is very difficult. As mentioned in the #dat IRC: "reasoning about network topology is hard, aka don't do it!".
We can get an estimate of the amount of people in the swarm by doing a lookup to the DHT and see how many IPs are in there. Might be a decent compromise for this
@mafintosh depends how good the estimations are. What's the likelihood of a viewer watching a stream and the DHT not knowing about it?
@louiscenter we'd need to test it for sure. the DHT usually knows all the peers watching a stream BUT might also contain peers NOT watching it.
sorry to jump in, maybe that bep could solve that issue (put/get + CAS)
http://www.bittorrent.org/beps/bep_0044.html
@mh-cbon cool find!
if it turns out that the DHT provides the information we need, this could work, but would that mean we'd constantly need our client to poll for that data, or would that information automatically be updated and delivered to us since we're already in the swarm?
yes, i think so. What i d though would be problematic is the peer leaving. If i close the app, i need to update that value, which may fail if the cas did not succeed, if that happens takes time, the unsub may fail: x
see also,
https://github.com/feross/bittorrent-dht#dhtputopts-callback
We don't need BEP44 for this. Just a normal lookup would be fine.
@mh-cbon cool! didn't know about bep50 :)
Is this open for someone to work on? I'd be down to tackle this.
@ColdSauce if you're volunteering, that would be great! I'd be happy to collaborate on this with you too, if it means we could find a solution that can work both across hypervision and hypercast
@louiscenter sounds good! What's the best way to get in touch with you to discuss this?
@ColdSauce if you're on freenode, you could join #hypercast