Display both pairs on selected candidate pair change (#3133)

* Display both pairs on selected canddiate pair change

* disable ICE lite for Firefox
This commit is contained in:
Raja Subramanian
2024-10-23 21:30:52 +05:30
committed by GitHub
parent 7ab6e5df09
commit de102f32db

View File

@@ -293,7 +293,11 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
//
se.DisableSRTPReplayProtection(true)
se.DisableSRTCPReplayProtection(true)
if !params.ProtocolVersion.SupportsICELite() {
if !params.ProtocolVersion.SupportsICELite() || !params.ClientInfo.SupportPrflxOverRelay() {
// if client don't support prflx over relay which is only Firefox, disable ICE Lite to ensure that
// dropping remote ICE candidates does not get enabled. Firefox does aggressive nomination and
// dropping remote ICE candidates means server would accept all switches and it could end up with
// the lower priority candidate. As Firefox does not support migration, ICE Lite can be disabled.
se.SetLite(false)
}
se.SetDTLSRetransmissionInterval(dtlsRetransmissionInterval)
@@ -473,8 +477,12 @@ func (t *PCTransport) createPeerConnection() error {
t.pc.SCTP().Transport().ICETransport().OnSelectedCandidatePairChange(func(pair *webrtc.ICECandidatePair) {
t.params.Logger.Debugw("selected ICE candidate pair changed", "pair", wrappedICECandidatePairLogger{pair})
t.connectionDetails.SetSelectedPair(pair)
if t.selectedPair.Load() != nil {
t.params.Logger.Infow("ice reconnected or switched pair", "pair", wrappedICECandidatePairLogger{pair})
existingPair := t.selectedPair.Load()
if existingPair != nil {
t.params.Logger.Infow(
"ice reconnected or switched pair",
"existingPair", wrappedICECandidatePairLogger{existingPair},
"newPair", wrappedICECandidatePairLogger{pair})
}
t.selectedPair.Store(pair)
})