@@ -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