diff --git a/app/Enums/Media/Type.php b/app/Enums/Media/Type.php index c916501e..935da839 100644 --- a/app/Enums/Media/Type.php +++ b/app/Enums/Media/Type.php @@ -18,20 +18,32 @@ public function label(): string } /** + * Allow-list of MIME types we accept on upload / URL fetch. + * + * Video accepts MP4 plus QuickTime/MOV. Modern .mov files (iPhone + * recordings, screen captures) are ISO BMFF containers — the same + * format MP4 uses — so social platforms decode them like MP4 even + * if PHP reports `video/quicktime`. Accepting MOV avoids forcing + * iPhone users to transcode before uploading. + * + * WebM is rejected: X / IG / TikTok / FB / Pinterest / Bluesky / + * Threads all reject the Matroska + VP8/VP9 stack. Without + * server-side transcoding, accepting WebM would just produce + * platform-specific publish failures down the line. + * * @return array */ public function allowedMimeTypes(): array { return match ($this) { self::Image => ['image/jpeg', 'image/png', 'image/gif', 'image/webp'], - self::Video => ['video/mp4', 'video/quicktime', 'video/webm'], + self::Video => ['video/mp4', 'video/quicktime'], }; } /** - * Filename extensions that match this type. Used by callers that - * validate by name (chunked upload, URL fetch fallback) instead of - * by MIME. + * Filename extensions that match this type. Mirrors allowedMimeTypes + * for callers that validate by name instead of MIME. * * @return array */ @@ -39,7 +51,7 @@ public function extensions(): array { return match ($this) { self::Image => ['jpg', 'jpeg', 'png', 'gif', 'webp'], - self::Video => ['mp4', 'mov', 'webm'], + self::Video => ['mp4', 'mov'], }; }