javascriptwebrtcrtcpeerconnection

How to get an RTCPeerConnection with audio&video bundle instead of 0&1


I am attempting to connect to an old WebRTC server, and it requires the sdp offer to contain "group:BUNDLE audio video", instead of the "group:BUNDLE 0 1" that modern day browsers have.

Example start of sdp in browser:

v=0\r\no=- 508130462041170902 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1\r\na=extmap-allow-mixed\r\n...

Example start of required sdp for server:

v=0\r\no=- 508130462041170902 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=extmap-allow-mixed\r\n...

Please note the change from "0 1" to "audio video".

Is there any way to, in javascript, create an RTCPeerConnection which has the "audio video" version of sdp? Simply editing the sdp before sending it to the server causes the answer sdp to be rejected by the RTCPeerConnection object, as it's "m-lines" are not the same.

Thanks in advance


Solution

  • There is not. Using audio and video was a convention used by Chrome when using the now-gone plan-b SDP semantics. The semantics of this attribute is that the server should respond with what the client sends. If you server software does not support this, consider using a server software that is not outdated.