From 20cb94729e9741115ebc7780b31896ab04759e11 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:36 -0400 Subject: [PATCH] Send MOV files as MP4 files --- app/routes/report.tsx | 9 ++++++--- functions/gcloud.ts | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/routes/report.tsx b/app/routes/report.tsx index 833727c..bb6d231 100644 --- a/app/routes/report.tsx +++ b/app/routes/report.tsx @@ -51,7 +51,7 @@ export default function () { jpg: "image/jpg", m4v: "video/x-m4v", mkv: "video/x-matroska", - mov: "video/quicktime", + mov: "video/mp4", mp4: "video/mp4", png: "image/png", webp: "image/webp", @@ -209,8 +209,11 @@ export default function () { duplex: supportsRequestStreams ? "half" : undefined, headers: { "content-type": - files[i].type || - fileTypes[files[i].name.split(".").at(-1) as string], + (files[i].name.split(".").at(-1) as string).toLowerCase() === + "mov" + ? "video/mp4" + : files[i].type || + fileTypes[files[i].name.split(".").at(-1) as string], }, method: "PUT", }); diff --git a/functions/gcloud.ts b/functions/gcloud.ts index 96e3110..d39264f 100644 --- a/functions/gcloud.ts +++ b/functions/gcloud.ts @@ -29,7 +29,7 @@ export async function GenerateUploadURL( jpg: "image/jpeg", m4v: "video/x-m4v", mkv: "video/x-matroska", - mov: "video/quicktime", + mov: "video/mp4", mp4: "video/mp4", png: "image/png", webp: "image/webp",