mirror of
https://github.com/livekit/livekit.git
synced 2026-10-15 17:40:16 +00:00
fix: enable H.264 publish for desktop Linux Firefox (#4949)
The static client config disabled H.264 publish for Firefox on Linux or Android. The Android workaround came from #2183, but the linux clause only ever hit desktop Linux Firefox, which publishes H.264 fine through OpenH264. Narrow the rule to Android only. Fixes #4929 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
b2d8d27a11
commit
6eb2e55388
@@ -51,7 +51,7 @@ var StaticConfigurations = []ConfigurationItem{
|
||||
},
|
||||
{
|
||||
Match: must.Get(NewScriptMatch(`(c.device_model == "xiaomi 2201117ti" && c.os == "android") ||
|
||||
((c.browser == "firefox" || c.browser == "firefox mobile") && (c.os == "linux" || c.os == "android"))`)),
|
||||
((c.browser == "firefox" || c.browser == "firefox mobile") && c.os == "android")`)),
|
||||
Configuration: &livekit.ClientConfiguration{
|
||||
DisabledCodecs: &livekit.DisabledCodecs{
|
||||
Publish: []*livekit.Codec{
|
||||
|
||||
@@ -19,10 +19,33 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/livekit/protocol/codecs/mime"
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/utils/must"
|
||||
)
|
||||
|
||||
func TestStaticConfigurationH264(t *testing.T) {
|
||||
cm := NewStaticClientConfigurationManager(StaticConfigurations)
|
||||
|
||||
h264Disabled := func(info *livekit.ClientInfo) bool {
|
||||
conf := cm.GetConfiguration(info)
|
||||
if conf == nil || conf.DisabledCodecs == nil {
|
||||
return false
|
||||
}
|
||||
for _, c := range conf.DisabledCodecs.Publish {
|
||||
if mime.IsMimeTypeStringH264(c.Mime) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// desktop Linux Firefox publishes H.264 through OpenH264, so it must not be disabled
|
||||
require.False(t, h264Disabled(&livekit.ClientInfo{Browser: "firefox", Os: "linux"}))
|
||||
// Firefox for Android is still worked around
|
||||
require.True(t, h264Disabled(&livekit.ClientInfo{Browser: "firefox mobile", Os: "android"}))
|
||||
}
|
||||
|
||||
func TestScriptMatchConfiguration(t *testing.T) {
|
||||
t.Run("no merge", func(t *testing.T) {
|
||||
confs := []ConfigurationItem{
|
||||
|
||||
Reference in New Issue
Block a user