From 76aef2d064755097903658e54607251046e88c2b Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 23 Apr 2024 15:55:01 -0700 Subject: [PATCH] use mp4 over webm (#3666) * use mp4 over webm * tinymp4 * safari only --- src/lib/strings/embed-player.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/strings/embed-player.ts b/src/lib/strings/embed-player.ts index b1fc75b8..5848f2af 100644 --- a/src/lib/strings/embed-player.ts +++ b/src/lib/strings/embed-player.ts @@ -352,8 +352,17 @@ export function parseEmbedPlayerFromUrl( if (id && filename && dimensions && id.includes('AAAAC')) { if (Platform.OS === 'web') { - id = id.replace('AAAAC', 'AAAP3') - filename = filename.replace('.gif', '.webm') + const isSafari = /^((?!chrome|android).)*safari/i.test( + navigator.userAgent, + ) + + if (isSafari) { + id = id.replace('AAAAC', 'AAAP1') + filename = filename.replace('.gif', '.mp4') + } else { + id = id.replace('AAAAC', 'AAAP3') + filename = filename.replace('.gif', '.webm') + } } else { id = id.replace('AAAAC', 'AAAAM') }