Disable h264 for android firefox (#2190)

* Disable H.264 for android firefox

* Fix syntax error for rule

* lower case

* Remove disabled codec from AddTrackRequest

* Consistent handling of enabled codecs

Mainly cleaning up where we are doing codec filtering.

There's also behavior change of how we handle codec compatibility. If a client doesn't support the client's desired codec, we'll pick a backup automatically
instead of rejecting the client's request.

Requires an update on multi-codec simulcast handling.

* fix alternative codec selection

---------

Co-authored-by: David Zhao <dz@livekit.io>
This commit is contained in:
cnderrauber
2023-10-27 14:47:36 +08:00
committed by GitHub
co-authored by David Zhao
parent 1f0ba21854
commit 3633dfe39e
9 changed files with 177 additions and 65 deletions
+6 -2
View File
@@ -26,7 +26,7 @@ type ClientInfo struct {
}
func (c ClientInfo) isFirefox() bool {
return c.ClientInfo != nil && strings.EqualFold(c.ClientInfo.Browser, "firefox")
return c.ClientInfo != nil && (strings.EqualFold(c.ClientInfo.Browser, "firefox") || strings.EqualFold(c.ClientInfo.Browser, "firefox mobile"))
}
func (c ClientInfo) isSafari() bool {
@@ -41,6 +41,10 @@ func (c ClientInfo) isLinux() bool {
return c.ClientInfo != nil && strings.EqualFold(c.ClientInfo.Os, "linux")
}
func (c ClientInfo) isAndroid() bool {
return c.ClientInfo != nil && strings.EqualFold(c.ClientInfo.Os, "android")
}
func (c ClientInfo) SupportsAudioRED() bool {
return !c.isFirefox() && !c.isSafari()
}
@@ -85,7 +89,7 @@ func (c ClientInfo) SupportsChangeRTPSenderEncodingActive() bool {
}
func (c ClientInfo) ComplyWithCodecOrderInSDPAnswer() bool {
return !(c.isLinux() && c.isFirefox())
return !((c.isLinux() || c.isAndroid()) && c.isFirefox())
}
// compareVersion compares a semver against the current client SDK version