From 76e384b188da8ed074451ae04cece168e6827b89 Mon Sep 17 00:00:00 2001 From: soxa <6390896+Soxasora@users.noreply.github.com> Date: Sun, 1 Dec 2024 02:12:13 +0100 Subject: [PATCH] fix can't upload from iOS camera/mov files (#1667) * fix can't upload from iOS camera/mov files * pivot: iOS automatically transcodes HEVC mov files to H264, custom error if codec not supported --- components/file-upload.js | 6 +++++- lib/constants.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/file-upload.js b/components/file-upload.js index d674ba43..f411c25d 100644 --- a/components/file-upload.js +++ b/components/file-upload.js @@ -106,7 +106,11 @@ export const FileUpload = forwardRef(({ children, className, onSelect, onUpload, if (onSelect) await onSelect?.(file, s3Upload) else await s3Upload(file) } catch (e) { - toaster.danger(`upload of '${file.name}' failed: ` + e.message || e.toString?.()) + if (file.type === 'video/quicktime') { + toaster.danger(`upload of '${file.name}' failed: codec might not be supported, check video settings`) + } else { + toaster.danger(`upload of '${file.name}' failed: ` + e.message || e.toString?.()) + } continue } } diff --git a/lib/constants.js b/lib/constants.js index 6bc88d50..978343ea 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -27,6 +27,7 @@ export const UPLOAD_TYPES_ALLOW = [ 'image/png', 'image/jpeg', 'image/webp', + 'video/quicktime', 'video/mp4', 'video/mpeg', 'video/webm'