Working with Peer IDs in the handleScSignal() Callback

The first order of business with the handleSCSignal() callback is to use a slightly more involved piece of destructuring assignment to work with the new values returned by the multipeer-capable signaling channel.

As you might’ve guessed back in Working with a Multipeer-Ready Signaling Channel, you now need to access the sender and signal values returned by the signaling channel, as well as the candidate and description values inside of signal. The parameters for handleScSignal() take on a slightly more complex look compared to the { description, candidate } destructured parameters for peer-to-peer signaling:

 async​ ​function​ handleScSignal({ sender,
  signal: { candidate, description ...

Get Programming WebRTC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.