WebRTC videoconferencing (many-to-many)

后端 未结 1 1445
难免孤独
难免孤独 2021-01-19 16:18

I am about to build a videoconferencing system using webRTC+socket.io+node.js, so I have read this book as start point \"Real Time communications with webRTC\" by Simon Piet

1条回答
  •  伪装坚强ぢ
    2021-01-19 16:47

    When C first receives offer from A, this is C setRemoteDescription(offerA), but when receiving offer from B, this is C setRemoteDescription(offerB), I am setting a new value here and losing the previous offer from A, is this procedure just temporary?, isn't C going to need the A offer anymore?

    You will need to have a peer connection (pc) in your client side per each other participant, you will do something similar to:

    socket.on('offer', function(from, data) {
        users[from].pc.setRemoteDescription(new RTCSessionDescription(data));
        // create answer..
    });
    

    Note that the Node server is sending the offer along with the id of the user who is sending it. Also, users will contain an entry per room participant with a reference to its pc. You will be adding the remote description for each participant to their own pc.

    There are plenty of examples in internet, mine is on http://github.com/jconde/euphony :)

    0 讨论(0)
提交回复
热议问题