react-native-webrtc: SessionDescription is NULL.
I’m currently trying to setup a RTCPeerConnection between a server and my react native client.
However when I set the remote description it fails with this error message:
{
name: 'SetRemoteDescriptionFailed',
message: 'SessionDescription is NULL.'
}
Code
const peer = new RTCPeerConnection({ iceServers: [...] })
const localOffer = await peer.createOffer();
await peer.setLocalDescription(localOffer);
// send local offer to server
// got sdp from server:
await peer.setRemoteDescription(new RTCSessionDescription({ sdp: sdp + "\n", type: "offer" }));
I have seen the duplicate issue #538 and tried adding \n at the end without success.
SDP
m=audio 50009 ICE/SDP
a=fingerprint:sha-256 4A:79:94:16:44:3F:BD:05:41:5A:C7:20:F3:12:54:70:00:73:5D:33:00:2D:2C:80:9B:39:E1:9F:2D:A7:49:87
c=IN IP4 109.200.198.210
a=rtcp:50009
a=ice-ufrag:n+TW
a=ice-pwd:wzVglE/Kni4AIslkP7XUOE
a=fingerprint:sha-256 4A:79:94:16:44:3F:BD:05:41:5A:C7:20:F3:12:54:70:00:73:5D:33:00:2D:2C:80:9B:39:E1:9F:2D:A7:49:87
a=candidate:1 1 UDP 4261412862 109.200.198.210 50009 typ host
I’m not sure if this is a bug or an issue on my side, but I’m glad for any help. Many thanks in advance and for taking the time to read this.
Platform information
- React Native version: 0.66.4
- Plugin version: 1.94.1
- OS: iOS 15.1.1
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (5 by maintainers)
Fixed in https://github.com/react-native-webrtc/react-native-webrtc/commit/576e8e877b96f401ca3a85e098fdeb767bb59359
@saghul Will share after some investigation 😉
in my case this can fix wrong sdp: https://stackoverflow.com/questions/66641204/sessiondescription-is-null-in-web-rtc-after-updating-chrome-to-latest-v-89-wor
@LightKnight3r It is probably not applicable for your project, because it is the way discord generates SDP but here you are:
I fixed my error by properly generating the SDP. I used
sdp-transformtogether with a custom lightweight transportation alternative to establish the call with much less overhead than the default 100kb SDP. However, there were some issues with the sdp media tracks in my implementation that I was able to fix and resolve the issue.@Flam3rboy Hi! Having the same problem, have you solved it? Could you share with your solution?
Don’t create a new RTCSessoonDecription, just pass a bare object.