Implementing Backward-Compatible Fixes
All the examples in this appendix represent modifications to the signaling- and WebRTC-callback logic from a basic peer-to-peer application. To see these fixes as applied to a multipeer application, have a look at the example in the book’s companion source code in the deploy/ directory.
Let’s look at these fixes in source-code order.
Adding a New State Property
The first fix is to add a new isSuppressingInitialOffer state property to $self:
| const $self = { |
| rtcConfig: null, |
| isPolite: false, |
| isMakingOffer: false, |
| isIgnoringOffer: false, |
| isSettingRemoteAnswerPending: false, |
» | isSuppressingInitialOffer: false, |
| mediaConstraints: { audio: true, video: true }, |
| mediaStream: new |
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.