Skip to content

Commit

Permalink
Disable VP9 for Safari 15, AV1 for Safari (incomplete support) (#950)
Browse files Browse the repository at this point in the history
* Disable VP9 for Safari 15 (incomplete support), AV1 for Safari

* changeset
  • Loading branch information
davidzhao authored Nov 30, 2023
1 parent 77301cb commit aed8748
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-steaks-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Disable VP9 for Safari 15, AV1 for Safari (incomplete support)
11 changes: 11 additions & 0 deletions src/room/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit aed8748

Please sign in to comment.