[Video] Upload tweaks (#5228)
* use correct mime type * fix wheel progress
This commit is contained in:
parent
95aee146b6
commit
6c6a76b193
3 changed files with 21 additions and 3 deletions
|
@ -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}`)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue