webrtc
webrtc copied to clipboard
Address differences between Go API and Wasm bindings
Summary
This issue lists all known API differences between the Go API and the Wasm bindings. Some of these already have their own issues.
List of Differences
- [ ] If no certificates are provided during initialization,
GetConfigurationreturns the default generated certificate in the Go API but no certificates in the Wasm bindings (See #513). - [x] (Fixed in https://github.com/pions/webrtc/pull/527). Some properties of
PeerConnectionare implemented as struct fields in the Go API but are methods in the Wasm bindings. Specifically:CurrentLocalDescriptionPendingLocalDescriptionCurrentRemoteDescriptionPendingRemoteDescriptionSignalingStateICEGatheringStateConnectionState
- [x] (Fixed in https://github.com/pions/webrtc/pull/524). Similarly, some properties of
DataChannelare implemented as struct fields in the Go API but are methods in the Wasm bindings:LabelOrderedMaxPacketLifeTimeMaxRetransmitsProtocolNegotiatedIDReadyStateBufferedAmountBufferedAmountLowThreshold
- [x] (Fixed in https://github.com/pions/webrtc/pull/546) In the Go API, ICE candidate gathering is synchronous but in the Wasm bindings, ICE candidate gathering happens in the background. The Go API is missing the
OnICECandidateandOnNegotiationNeededmethods. - [ ] The Wasm bindings do not support certificates or credentials (See #499). This might not be addressed before the v2 release.
- [x] The Wasm bindings do not support tracks, streams, or media (See #500). This might not be addressed before the v2 release.
- [ ] The Wasm bindings do not support the
BufferedAmountmethods (introduced in https://github.com/pions/webrtc/pull/572). - [ ] The Wasm bindings can't properly subscribe to OnOpen callback when creating a DataChannel. This function might return an already opened DataChannel.
Once we have addressed this differences, it should be possible to create a (probably unexported) interface to help enforce homogeneity between the two APIs going forward. This is what @backkem suggested here.
All the subtasks have been resolved.
The API differences between WASM/Go are unfortunate, but surprisingly no user has brought it up!