loosen checks on vtt file (#5359)

This commit is contained in:
Samuel Newman 2024-09-16 17:29:34 +01:00 committed by GitHub
parent 0681727b64
commit d62e14eca1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,8 +28,9 @@ export function SubtitleFilePicker({
if (selectedFile) {
if (
selectedFile.type === 'text/vtt' ||
(selectedFile.type === 'text/plain' &&
selectedFile.name.endsWith('.vtt'))
// HACK: sometimes the mime type is just straight-up missing
// best we can do is check the file extension and hope for the best
selectedFile.name.endsWith('.vtt')
) {
onSelectFile(selectedFile)
} else {