APP-2884: Avoid base64 reads for web videos (#11493)

This commit is contained in:
Spence Pope
2026-08-18 09:26:26 -04:00
committed by GitHub
parent e87ec032cd
commit df3cea1c78
2 changed files with 14 additions and 8 deletions
+5 -2
View File
@@ -8,7 +8,7 @@ import {t} from '@lingui/core/macro'
import {type ImageMeta} from '#/state/gallery'
import * as Toast from '#/components/Toast'
import {IS_IOS, IS_WEB} from '#/env'
import {IS_IOS} from '#/env'
import {VIDEO_MAX_DURATION_MS} from '../constants'
import {getDataUriSize} from './util'
@@ -58,7 +58,10 @@ export async function openUnifiedPicker({
quality: 1,
allowsMultipleSelection: true,
legacy: true,
base64: IS_WEB,
// Reading videos as base64 can fail in the browser before callers have a
// chance to validate the file size. Web callers can read image files from
// the `file` returned on each asset after validation instead.
base64: false,
selectionLimit: IS_IOS ? selectionCountRemaining : undefined,
preferredAssetRepresentationMode:
UIImagePickerPreferredAssetRepresentationMode.Automatic,