add simulate switch candidate (#754)

* add simulate switch candidate

* update go mod
This commit is contained in:
cnderrauber
2022-06-07 17:56:41 +08:00
committed by GitHub
parent e72fd80ca0
commit 90ae3892b3
7 changed files with 77 additions and 11 deletions
+16
View File
@@ -179,6 +179,22 @@ func (p *ParticipantImpl) SendRefreshToken(token string) error {
}
func (p *ParticipantImpl) sendIceCandidate(c *webrtc.ICECandidate, target livekit.SignalTarget) {
var filterOut bool
p.lock.RLock()
if target == livekit.SignalTarget_SUBSCRIBER {
if p.iceConfig.PreferSubTcp && c.Protocol != webrtc.ICEProtocolTCP {
filterOut = true
}
} else if target == livekit.SignalTarget_PUBLISHER {
if p.iceConfig.PreferPubTcp && c.Protocol != webrtc.ICEProtocolTCP {
filterOut = true
}
}
p.lock.RUnlock()
if filterOut {
return
}
ci := c.ToJSON()
// write candidate