diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/constants.ts | 1 | ||||
-rw-r--r-- | src/lib/media/video/util.ts | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/constants.ts b/src/lib/constants.ts index cd9183c95..ee066d919 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -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] diff --git a/src/lib/media/video/util.ts b/src/lib/media/video/util.ts index 87b422c2c..b80e0a4a1 100644 --- a/src/lib/media/video/util.ts +++ b/src/lib/media/video/util.ts @@ -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}`) } |