Skip to content

Instantly share code, notes, and snippets.

@droganaida
Last active March 28, 2022 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save droganaida/d0b23804321ad90764f333d63dd3f95d to your computer and use it in GitHub Desktop.
Save droganaida/d0b23804321ad90764f333d63dd3f95d to your computer and use it in GitHub Desktop.
Find function webRtcPlayerObj.onWebRtcOffer in app.js file, add removeExtmapAllowMixed(offer); in the beginning of IF. Then add function removeExtmapAllowMixed(desc) to remove a=extmap-allow-mixed
webRtcPlayerObj.onWebRtcOffer = function (offer) {
if (ws && ws.readyState === WS_OPEN_STATE) {
removeExtmapAllowMixed(offer);
let offerStr = JSON.stringify(offer);
console.log(`-> SS: offer:\n${offerStr}`);
ws.send(offerStr);
}
};
function removeExtmapAllowMixed(desc) {
/* remove a=extmap-allow-mixed for webrtc.org 1 < M71 */
if (!window.RTCPeerConnection) {
return;
}
if(desc.sdp.indexOf('\na=extmap-allow-mixed') !== -1){
const sdp = desc.sdp.split('\n').filter((line) => {
return line.trim() !== 'a=extmap-allow-mixed';
}).join('\n');
desc.sdp = sdp;
return sdp;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment