peerjs-server icon indicating copy to clipboard operation
peerjs-server copied to clipboard

AspNet Core port + feature request

Open cristipufu opened this issue 4 years ago • 0 comments

Hi guys,

First of all I want to thank you all for the time, talent and work you've invested in this project, it's awesome.

Recently I started porting this project to .Net Core (with a few tweaks), so here's the repository: https://github.com/cristipufu/peerjs-server.net. I'm planning to continue to work/improve/extend it:

  • Finish the port, as I still have some things to do (configurable settings, etc)
  • Add a backing Redis store for multi-node deployments (this is a little bit tricky - needs pub/sub between nodes & stuff)
  • Deploy it as a NuGet package, so other users can easily include it in their AspNet Core projects.

However, in the same time I'm trying to do a "conference video call" demo module for an online board game. I feel like I'm missing a "broadcast" feature in the JS library.

At the moment we can call a user through this API:

// Call a peer, providing our mediaStream
var call = peer.call(clientId, mediaStream);
call.on('stream', function (stream) {
  peerVideo.srcObject = stream;
});

What I would like to do, would be something like (which would basically broadcast my media stream to all the clients connected with the same API key - in the .NET port we instantiate one realm for each API key):

// Broadcast our mediaStream to all connected peers
var call = peer.broadcast(mediaStream);
call.on('stream', function (stream) {
  peerVideo.srcObject = stream;
});

This way, everything would just work, like magic, as it would be quite easy for me to handle this on the server-side. (I know we can get a list of connected peers, and try to call each one on the client side - but it just doesn't feel right).

Any opinions, ideas on the matter?

Thanks

cristipufu avatar Apr 11 '20 10:04 cristipufu