use mp4 over webm (#3666)

* use mp4 over webm

* tinymp4

* safari only
zio/stable
Hailey 2024-04-23 15:55:01 -07:00 committed by GitHub
parent 316fce6439
commit 76aef2d064
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 2 deletions

View File

@ -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')
}