Add gif support to web (#6433)
* add gif support to web
* rm set dimensions
* rm effect from preview
* rm log
* rm use of {cause: error}
* fix lint
This commit is contained in:
@@ -154,6 +154,7 @@ export const SUPPORTED_MIME_TYPES = [
|
||||
'video/mpeg',
|
||||
'video/webm',
|
||||
'video/quicktime',
|
||||
'image/gif',
|
||||
] as const
|
||||
|
||||
export type SupportedMimeTypes = (typeof SUPPORTED_MIME_TYPES)[number]
|
||||
|
||||
@@ -32,6 +32,8 @@ export function mimeToExt(mimeType: SupportedMimeTypes | (string & {})) {
|
||||
return 'mpeg'
|
||||
case 'video/quicktime':
|
||||
return 'mov'
|
||||
case 'image/gif':
|
||||
return 'gif'
|
||||
default:
|
||||
throw new Error(`Unsupported mime type: ${mimeType}`)
|
||||
}
|
||||
@@ -47,6 +49,8 @@ export function extToMime(ext: string) {
|
||||
return 'video/mpeg'
|
||||
case 'mov':
|
||||
return 'video/quicktime'
|
||||
case 'gif':
|
||||
return 'image/gif'
|
||||
default:
|
||||
throw new Error(`Unsupported file extension: ${ext}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user