From 0931dc030050c3d1b71918c54bb1cd6f05df28ff Mon Sep 17 00:00:00 2001 From: David Zhao Date: Sat, 7 Oct 2023 00:00:52 -0700 Subject: [PATCH] Handle playoutDelay for Firefox (#2135) We will need to disable playoutDelay for FF users if the developer is assuming streams are synced. --- pkg/rtc/participant.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 5685dca77..d2f5fee48 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -1095,7 +1095,7 @@ func (p *ParticipantImpl) UpdateMediaRTT(rtt uint32) { } func (p *ParticipantImpl) setupTransportManager() error { - tm, err := NewTransportManager(TransportManagerParams{ + params := TransportManagerParams{ Identity: p.params.Identity, SID: p.params.SID, // primary connection does not change, canSubscribe can change if permission was updated @@ -1116,7 +1116,13 @@ func (p *ParticipantImpl) setupTransportManager() error { TURNSEnabled: p.params.TURNSEnabled, AllowPlayoutDelay: p.params.PlayoutDelay.GetEnabled(), Logger: p.params.Logger.WithComponent(sutils.ComponentTransport), - }) + } + if p.params.SyncStreams && p.params.PlayoutDelay.GetEnabled() && p.params.ClientInfo.isFirefox() { + // we will disable playout delay for Firefox if the user is expecting + // the streams to be synced. Firefox doesn't support SyncStreams + params.AllowPlayoutDelay = false + } + tm, err := NewTransportManager(params) if err != nil { return err }