Is my understanding of WebRTC protocol Correct?

2019-08-20 10:01发布

问题:

This is how I understand the protocol...

  • user on browser get media stream
  • generates own sdp (data on codecs, security, etc)
  • creates an offer with it
  • send this offer to server via signalling method (websocket)
  • signalling server, looks who is this offer for and redirect it to that client
  • client 2's browser gets the offer with sdp and in turn generate its own offer with its own sdp and send it to server
  • server redirect client 2's offer to client 1. now both know each other specs.

Meanwhile, however...

  • as soon as whichever client sends offer with sdp they also start to contact ICE (stun) server(s) to get possible reachable path to them via correct PublicIP:Port:Protocol combo, which they also send to another client via signalling server.

回答1:

Client 2 generates an answer (using createAnswer), not an offer. The main difference is that an answer is a subset of the capabilities (like codecs) contained in the offer.

Otherwise this sounds good.