From f8f143e8e86390a744df4a9f2b67a52713a3ce1d Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty Date: Wed, 15 Nov 2023 10:26:17 -0500 Subject: [PATCH] fix(codec-selection): Select VP8 as default codec. When RTCRtpReceiver.getCapabilities() is not supported by browser or if it returns an empty list. Fixes an issue where call doesn't get established in Firefox ESR 102. Fixes https://github.com/jitsi/jitsi-meet/issues/13839. --- modules/RTC/CodecSelection.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/RTC/CodecSelection.js b/modules/RTC/CodecSelection.js index 8b655e531e..162da7e80e 100644 --- a/modules/RTC/CodecSelection.js +++ b/modules/RTC/CodecSelection.js @@ -112,9 +112,15 @@ export class CodecSelection { ? MOBILE_P2P_VIDEO_CODEC_ORDER : browser.isMobileDevice() ? MOBILE_VIDEO_CODEC_ORDER : DESKTOP_VIDEO_CODEC_ORDER; - return videoCodecMimeTypes.filter(codec => + const supportedCodecs = videoCodecMimeTypes.filter(codec => (window.RTCRtpReceiver?.getCapabilities?.(MediaType.VIDEO)?.codecs ?? []) .some(supportedCodec => supportedCodec.mimeType.toLowerCase() === `${MediaType.VIDEO}/${codec}`)); + + // Select VP8 as the default codec if RTCRtpReceiver.getCapabilities() is not supported by the browser or if it + // returns an empty set. + !supportedCodecs.length && supportedCodecs.push(CodecMimeType.VP8); + + return supportedCodecs; } /**