Skip to content

Commit

Permalink
safari: dont remove a=extmap-allow-mixed in current safari
Browse files Browse the repository at this point in the history
which does support parsing the extmap-allow-mixed attribute. See
  https://bugs.chromium.org/p/webrtc/issues/detail?id=9985
  • Loading branch information
fippo committed May 25, 2020
1 parent b428859 commit 1934851
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/common_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,19 +318,22 @@ export function shimConnectionState(window) {
}

export function removeAllowExtmapMixed(window) {
/* remove a=extmap-allow-mixed for Chrome < M71 */
/* remove a=extmap-allow-mixed for webrtc.org < M71 */
if (!window.RTCPeerConnection) {
return;
}
const browserDetails = utils.detectBrowser(window);
if (browserDetails.browser === 'chrome' && browserDetails.version >= 71) {
return;
}
if (browserDetails.browser === 'safari' && browserDetails.version >= 605) {
return;
}
const nativeSRD = window.RTCPeerConnection.prototype.setRemoteDescription;
window.RTCPeerConnection.prototype.setRemoteDescription =
function setRemoteDescription(desc) {
if (desc && desc.sdp && desc.sdp.indexOf('\na=extmap-allow-mixed') !== -1) {
desc.sdp = desc.sdp.split('\n').filter((line) => {
arguments[0] = {type: desc.type, sdp: desc.sdp.split('\n').filter((line) => {
return line.trim() !== 'a=extmap-allow-mixed';
}).join('\n');
}
Expand Down

0 comments on commit 1934851

Please sign in to comment.