Skip to content

Commit

Permalink
fix(codec-selection): Select VP8 as default codec.
Browse files Browse the repository at this point in the history
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 jitsi/jitsi-meet#13839.
  • Loading branch information
jallamsetty1 authored and subhamcyara committed Jul 19, 2024
1 parent d748365 commit ead51b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/RTC/CodecSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit ead51b6

Please sign in to comment.