[Video] Upload tweaks (#5228)

* use correct mime type

* fix wheel progress
This commit is contained in:
Samuel Newman
2024-09-08 16:27:50 +01:00
committed by GitHub
parent 95aee146b6
commit 6c6a76b193
3 changed files with 21 additions and 3 deletions
+15
View File
@@ -39,3 +39,18 @@ export function mimeToExt(mimeType: SupportedMimeTypes | (string & {})) {
throw new Error(`Unsupported mime type: ${mimeType}`)
}
}
export function extToMime(ext: string) {
switch (ext) {
case 'mp4':
return 'video/mp4'
case 'webm':
return 'video/webm'
case 'mpeg':
return 'video/mpeg'
case 'mov':
return 'video/quicktime'
default:
throw new Error(`Unsupported file extension: ${ext}`)
}
}