I have this JS code:
const pc = new RTCPeerConnection(configuration);
pcPeers[socketId] = pc;
pc.onicecandidate = function (event) {
// ...
};
pc.onnegotiationneeded = function () {
// ...
};
pc.oniceconnectionstatechange = function (event) {
// ...
};
pc.onsignalingstatechange = function (event) {
// ...
};
pc.onaddstream = function (event) {
// ...
};
pc.addStream(localStream);
return pc;
pc.addStream will fail to add the stream to the PeerConnection. I dug deeper in objective-c code (I have no prior experience with objc) and I found out that WebRTCModule+RTCPeerConnection.m:96 does not create a peerConnection but returns null. I cannot “step into” this call.
RTCPeerConnection *peerConnection
= [self.peerConnectionFactory peerConnectionWithConfiguration:configuration
constraints:constraints
delegate:self];