medooze / media-server-node

WebRTC Media Server for Node.js
MIT License
802 stars 119 forks source link

SDP with no tracks causes exception in transport creation #165

Open james-pellow opened 3 years ago

james-pellow commented 3 years ago

If I generate an offer with no tracks, for example:

const pc = new RTCPeerConnection({});
const offer = await pc.createOffer();

In chrome m87 I get an offer that looks like:

v=0
o=- 8401431966283103841 2 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS

Now if I send that to Medooze on the server side, I get an exception "No remote ICE or DTLS info provided"

In the endpoint createTransport code, we are checking for ICE or DTLS info in the remote description and throwing an error if its not found. This means we can't create a transport in the case where we are not sending any media from the client. I mentioned this challenge in Structure for group conversation in the support forum and you requested that I create a ticket. Thank you for taking a look at this!

james-pellow commented 3 years ago

The solution is to add trackless transceivers to the pc before generating the offer for anyone else that may be experiencing the same issue.