send padding packets of muted uptrack for go sdk (#1283)

This commit is contained in:
cnderrauber
2023-01-04 16:01:04 +08:00
committed by GitHub
parent cbc7d43ba4
commit fe4da84ee9
4 changed files with 70 additions and 12 deletions
+9
View File
@@ -19,6 +19,10 @@ func (c ClientInfo) isSafari() bool {
return c.ClientInfo != nil && strings.EqualFold(c.ClientInfo.Browser, "safari")
}
func (c ClientInfo) isGo() bool {
return c.ClientInfo != nil && c.ClientInfo.Sdk == livekit.ClientInfo_GO
}
func (c ClientInfo) SupportsAudioRED() bool {
return !c.isFirefox() && !c.isSafari()
}
@@ -27,6 +31,11 @@ func (c ClientInfo) SupportPrflxOverRelay() bool {
return !c.isFirefox()
}
// GoSDK(pion) relies on rtp packets to fire ontrack event, browsers and native (libwebrtc) rely on sdp
func (c ClientInfo) FireTrackByRTPPacket() bool {
return c.isGo()
}
// CompareVersion compares two semver versions
// returning 1 if current version is greater than version
// 0 if they are the same, and -1 if it's an earlier version
+4
View File
@@ -970,6 +970,10 @@ func (p *ParticipantImpl) AddSubscribedTrack(subTrack types.SubscribedTrack, sou
settings := p.subscribedTracksSettings[subTrack.ID()]
p.lock.Unlock()
if p.params.ClientInfo.FireTrackByRTPPacket() {
subTrack.DownTrack().SetActivePaddingOnMuteUpTrack()
}
subTrack.OnBind(func() {
if p.TransportManager.HasSubscriberEverConnected() {
subTrack.DownTrack().SetConnected()