June 2024
Beginner to intermediate
268 pages
6h 26m
English
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.
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 |
Read now
Unlock full access