From aed874803259173b251311a3c7ac66f38ebd4a32 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 30 Nov 2023 12:24:03 -0800 Subject: [PATCH] Disable VP9 for Safari 15, AV1 for Safari (incomplete support) (#950) * Disable VP9 for Safari 15 (incomplete support), AV1 for Safari * changeset --- .changeset/wild-steaks-switch.md | 5 +++++ src/room/utils.ts | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .changeset/wild-steaks-switch.md diff --git a/.changeset/wild-steaks-switch.md b/.changeset/wild-steaks-switch.md new file mode 100644 index 0000000000..58037ec06c --- /dev/null +++ b/.changeset/wild-steaks-switch.md @@ -0,0 +1,5 @@ +--- +'livekit-client': patch +--- + +Disable VP9 for Safari 15, AV1 for Safari (incomplete support) diff --git a/src/room/utils.ts b/src/room/utils.ts index 06e7086d1b..228ef72cda 100644 --- a/src/room/utils.ts +++ b/src/room/utils.ts @@ -47,6 +47,10 @@ export function supportsAV1(): boolean { if (!('getCapabilities' in RTCRtpSender)) { return false; } + if (isSafari()) { + // Safari 17 on iPhone14 reports AV1 capability, but does not actually support it + return false; + } const capabilities = RTCRtpSender.getCapabilities('video'); let hasAV1 = false; if (capabilities) { @@ -69,6 +73,13 @@ export function supportsVP9(): boolean { // https://bugzilla.mozilla.org/show_bug.cgi?id=1633876 return false; } + if (isSafari()) { + const browser = getBrowser(); + if (browser?.version && compareVersions(browser.version, '16') < 0) { + // Safari 16 and below does not support VP9 + return false; + } + } const capabilities = RTCRtpSender.getCapabilities('video'); let hasVP9 = false; if (capabilities) {