fix can't upload mp4 on safari (#1617)

This commit is contained in:
Simone Cervino 2024-11-20 14:06:05 +01:00 committed by GitHub
parent 6bae1f1a89
commit c88afc5aae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -78,6 +78,11 @@ export const FileUpload = forwardRef(({ children, className, onSelect, onUpload,
element.onerror = reject
element.src = window.URL.createObjectURL(file)
// iOS Force the video to load metadata
if (element.tagName === 'VIDEO') {
element.load()
}
})
}, [toaster, getSignedPOST])