Skip to content

Commit 20452f0

Browse files
committed
media: set renomination on the remote description as well
1 parent 353d4ef commit 20452f0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/media/src/webrtc/P2pRtcManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ export default class P2pRtcManager implements RtcManager {
490490
? MAXIMUM_TURN_BANDWIDTH_UNLIMITED
491491
: MAXIMUM_TURN_BANDWIDTH,
492492
deprioritizeH264Encoding,
493+
iceRenominationOn: this._features.iceRenominationOn,
493494
});
494495

495496
this.totalSessionsCreated++;

packages/media/src/webrtc/Session.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default class Session {
3333
registerConnected: any;
3434
offerOptions: { offerToReceiveAudio: boolean; offerToReceiveVideo: boolean };
3535
_deprioritizeH264Encoding: any;
36+
_iceRenominationOn: boolean;
3637
clientId: any;
3738
peerConnectionConfig: any;
3839
shouldAddLocalVideo: any;
@@ -44,11 +45,13 @@ export default class Session {
4445
bandwidth,
4546
maximumTurnBandwidth,
4647
deprioritizeH264Encoding,
48+
iceRenominationOn,
4749
}: {
4850
peerConnectionId: any;
4951
bandwidth: any;
5052
maximumTurnBandwidth: any;
5153
deprioritizeH264Encoding: any;
54+
iceRenominationOn: boolean;
5255
}) {
5356
this.peerConnectionId = peerConnectionId;
5457
this.relayCandidateSeen = false;
@@ -78,6 +81,7 @@ export default class Session {
7881
});
7982
this.offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
8083
this._deprioritizeH264Encoding = deprioritizeH264Encoding;
84+
this._iceRenominationOn = iceRenominationOn;
8185
}
8286

8387
setAndGetPeerConnection({
@@ -195,6 +199,7 @@ export default class Session {
195199

196200
sdp = sdpModifier.filterMidExtension(sdp);
197201
sdp = sdpModifier.filterMsidSemantic(sdp);
202+
if (this._iceRenominationOn) sdp = sdpModifier.enableIceRenomination(sdp);
198203

199204
const desc = { type: message.type, sdp };
200205
// Create an answer to send to the client that sent the offer
@@ -217,7 +222,8 @@ export default class Session {
217222
}
218223

219224
handleAnswer(message: any) {
220-
const sdp = sdpModifier.filterMsidSemantic(message.sdp);
225+
let sdp = sdpModifier.filterMsidSemantic(message.sdp);
226+
if (this._iceRenominationOn) sdp = sdpModifier.enableIceRenomination(sdp);
221227

222228
const desc = { type: message.type, sdp };
223229
return this._setRemoteDescription(desc).then(
@@ -226,7 +232,7 @@ export default class Session {
226232
},
227233
(e: any) => {
228234
logger.warn("Could not set remote description from remote answer: ", e);
229-
}
235+
},
230236
);
231237
}
232238

@@ -428,7 +434,7 @@ export default class Session {
428434
videoTransceiver?.direction !== "recvonly" &&
429435
videoTransceiver?.receiver?.track?.kind === "video" &&
430436
!excludedTrackIds.includes(videoTransceiver?.receiver?.track?.id) &&
431-
!excludedTrackIds.includes(videoTransceiver?.sender?.track?.id)
437+
!excludedTrackIds.includes(videoTransceiver?.sender?.track?.id),
432438
)
433439
.forEach((videoTransceiver: any) => {
434440
videoTransceiver.direction = enable ? "sendonly" : "sendrecv";

0 commit comments

Comments
 (0)