merge: Support video/x-matroska (MKV) files for embed (!1214)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1214

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Hazelnoot 2025-09-13 14:32:57 -04:00
commit 364e189721
3 changed files with 18 additions and 0 deletions

View file

@ -56,6 +56,9 @@ export const FILE_TYPE_BROWSERSAFE = [
'video/webm',
'audio/webm',
// MKV files
'video/x-matroska',
'audio/aac',
// see https://github.com/misskey-dev/misskey/pull/10686

View file

@ -34,6 +34,7 @@ type Q =
{ op: 'or', qs: Q[] } |
{ op: 'not', q: Q };
// Sync with consts.ts and const.ts
const fileTypes = {
image: [
'image/webp',
@ -42,12 +43,20 @@ const fileTypes = {
'image/avif',
'image/apng',
'image/gif',
'image/bmp',
'image/tiff',
'image/x-icon',
],
video: [
'video/mp4',
'video/webm',
'video/mpeg',
'video/x-m4v',
'video/ogg',
'video/quicktime',
'video/3gpp',
'video/3gpp2',
'video/x-matroska',
],
audio: [
'audio/mpeg',
@ -58,6 +67,9 @@ const fileTypes = {
'audio/opus',
'audio/ogg',
'audio/x-m4a',
'audio/mp4',
'audio/x-flac',
'audio/vnd.wave',
'audio/mod',
'audio/s3m',
'audio/xm',