Skip to content

Commit

Permalink
Add adapter artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
KaptenJansson committed Feb 3, 2017
1 parent 40a18fc commit 8af2b5c
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 56 deletions.
49 changes: 24 additions & 25 deletions release/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,7 @@ var edgeShim = {
if (recv && transceiver.rtpReceiver) {
// remove RTX field in Edge 14942
if (transceiver.kind === 'video'
&& transceiver.recvEncodingParameters
&& browserDetails.version < 15019) {
&& transceiver.recvEncodingParameters) {
transceiver.recvEncodingParameters.forEach(function(p) {
delete p.rtx;
});
Expand Down Expand Up @@ -1657,26 +1656,6 @@ var edgeShim = {
.filter(function(cand) {
return cand.component === '1';
});
localCapabilities = RTCRtpReceiver.getCapabilities(kind);

// filter RTX until additional stuff needed for RTX is implemented
// in adapter.js
localCapabilities.codecs = localCapabilities.codecs.filter(
function(codec) {
return codec.name !== 'rtx';
});
var commonCodecs = self._getCommonCapabilities(
localCapabilities,
remoteCapabilities).codecs;
commonCodecs = commonCodecs.map(function(codec) {
return codec.name;
});
if (commonCodecs.length === 0 ||
(commonCodecs.indexOf('H264') === -1 &&
commonCodecs.indexOf('VP8') === -1)) {
rejected = true;
}

if (description.type === 'offer' && !rejected) {
var transports = self.usingBundle && sdpMLineIndex > 0 ? {
iceGatherer: self.transceivers[0].iceGatherer,
Expand All @@ -1688,6 +1667,14 @@ var edgeShim = {
transports.iceTransport.setRemoteCandidates(cands);
}

localCapabilities = RTCRtpReceiver.getCapabilities(kind);

// filter RTX until additional stuff needed for RTX is implemented
// in adapter.js
localCapabilities.codecs = localCapabilities.codecs.filter(
function(codec) {
return codec.name !== 'rtx';
});

sendEncodingParameters = [{
ssrc: (2 * sdpMLineIndex + 2) * 1001
Expand Down Expand Up @@ -2387,9 +2374,21 @@ var firefoxShim = {
if (browserDetails.version < 53 && !onSucc) {
// Shim only promise getStats with spec-hyphens in type names
// Leave callback version alone; misc old uses of forEach before Map
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
try {
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
} catch (e) {
if (e.name !== 'TypeError') {
throw e;
}
// Avoid TypeError: "type" is read-only, in old versions. 34-43ish
stats.forEach(function(stat, i) {
stats.set(i, Object.assign({}, stat, {
type: modernStatsTypes[stat.type] || stat.type
}));
});
}
}
return stats;
})
Expand Down
18 changes: 15 additions & 3 deletions release/adapter_no_edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,21 @@ var firefoxShim = {
if (browserDetails.version < 53 && !onSucc) {
// Shim only promise getStats with spec-hyphens in type names
// Leave callback version alone; misc old uses of forEach before Map
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
try {
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
} catch (e) {
if (e.name !== 'TypeError') {
throw e;
}
// Avoid TypeError: "type" is read-only, in old versions. 34-43ish
stats.forEach(function(stat, i) {
stats.set(i, Object.assign({}, stat, {
type: modernStatsTypes[stat.type] || stat.type
}));
});
}
}
return stats;
})
Expand Down
18 changes: 15 additions & 3 deletions release/adapter_no_edge_no_global.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,21 @@ var firefoxShim = {
if (browserDetails.version < 53 && !onSucc) {
// Shim only promise getStats with spec-hyphens in type names
// Leave callback version alone; misc old uses of forEach before Map
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
try {
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
} catch (e) {
if (e.name !== 'TypeError') {
throw e;
}
// Avoid TypeError: "type" is read-only, in old versions. 34-43ish
stats.forEach(function(stat, i) {
stats.set(i, Object.assign({}, stat, {
type: modernStatsTypes[stat.type] || stat.type
}));
});
}
}
return stats;
})
Expand Down
49 changes: 24 additions & 25 deletions release/adapter_no_global.js
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,7 @@ var edgeShim = {
if (recv && transceiver.rtpReceiver) {
// remove RTX field in Edge 14942
if (transceiver.kind === 'video'
&& transceiver.recvEncodingParameters
&& browserDetails.version < 15019) {
&& transceiver.recvEncodingParameters) {
transceiver.recvEncodingParameters.forEach(function(p) {
delete p.rtx;
});
Expand Down Expand Up @@ -1657,26 +1656,6 @@ var edgeShim = {
.filter(function(cand) {
return cand.component === '1';
});
localCapabilities = RTCRtpReceiver.getCapabilities(kind);

// filter RTX until additional stuff needed for RTX is implemented
// in adapter.js
localCapabilities.codecs = localCapabilities.codecs.filter(
function(codec) {
return codec.name !== 'rtx';
});
var commonCodecs = self._getCommonCapabilities(
localCapabilities,
remoteCapabilities).codecs;
commonCodecs = commonCodecs.map(function(codec) {
return codec.name;
});
if (commonCodecs.length === 0 ||
(commonCodecs.indexOf('H264') === -1 &&
commonCodecs.indexOf('VP8') === -1)) {
rejected = true;
}

if (description.type === 'offer' && !rejected) {
var transports = self.usingBundle && sdpMLineIndex > 0 ? {
iceGatherer: self.transceivers[0].iceGatherer,
Expand All @@ -1688,6 +1667,14 @@ var edgeShim = {
transports.iceTransport.setRemoteCandidates(cands);
}

localCapabilities = RTCRtpReceiver.getCapabilities(kind);

// filter RTX until additional stuff needed for RTX is implemented
// in adapter.js
localCapabilities.codecs = localCapabilities.codecs.filter(
function(codec) {
return codec.name !== 'rtx';
});

sendEncodingParameters = [{
ssrc: (2 * sdpMLineIndex + 2) * 1001
Expand Down Expand Up @@ -2387,9 +2374,21 @@ var firefoxShim = {
if (browserDetails.version < 53 && !onSucc) {
// Shim only promise getStats with spec-hyphens in type names
// Leave callback version alone; misc old uses of forEach before Map
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
try {
stats.forEach(function(stat) {
stat.type = modernStatsTypes[stat.type] || stat.type;
});
} catch (e) {
if (e.name !== 'TypeError') {
throw e;
}
// Avoid TypeError: "type" is read-only, in old versions. 34-43ish
stats.forEach(function(stat, i) {
stats.set(i, Object.assign({}, stat, {
type: modernStatsTypes[stat.type] || stat.type
}));
});
}
}
return stats;
})
Expand Down

0 comments on commit 8af2b5c

Please sign in to comment.