Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(voice): prefer vp8 for automatic screen shares in firefox (#3109)

Hampus69786d3b4967
diff --git a/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.ts b/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.ts
index 402f31fda..198eabde5 100644
--- a/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.ts
+++ b/fluxer_app/src/features/voice/utils/ScreenShareCodecSelection.ts
@@ -5,6 +5,7 @@ import type {VideoCodec} from 'livekit-client';
export const CODEC_PREFERENCE: ReadonlyArray<VideoCodec> = ['av1', 'h265', 'h264', 'vp9', 'vp8'];
const SOFTWARE_H264_CODEC_PREFERENCE: ReadonlyArray<VideoCodec> = ['av1', 'h265', 'vp9', 'h264', 'vp8'];
+const GECKO_CODEC_PREFERENCE: ReadonlyArray<VideoCodec> = ['vp8', 'h264'];
const COMPATIBILITY_CODECS: ReadonlySet<VideoCodec> = new Set(['h264', 'vp9', 'vp8']);
export const LAST_RESORT_VIDEO_CODEC: VideoCodec = 'vp8';
const BASELINE_BROWSER_CODECS: ReadonlySet<VideoCodec> = new Set(['h264', 'vp8']);
@@ -104,7 +105,12 @@ export function rankScreenShareCodecs(input: ScreenShareCodecRankingInput): Scre
if (codec === 'h265') return pin === 'h265' || (input.encoderModeSetting !== 'software' && isHardware('h265'));
return true;
};
- const preference = isHardware('h264') ? CODEC_PREFERENCE : SOFTWARE_H264_CODEC_PREFERENCE;
+ const preference =
+ input.profile.browser === 'firefox'
+ ? GECKO_CODEC_PREFERENCE
+ : isHardware('h264')
+ ? CODEC_PREFERENCE
+ : SOFTWARE_H264_CODEC_PREFERENCE;
const survivors = preference.filter(survives);
const ranked =
input.encoderModeSetting === 'software'