From a863a5cbf3186c1fef8734bc94e71f42925587c6 Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Sat, 1 Aug 2026 17:41:37 +0200 Subject: [PATCH] Serve uploaded MP4s at /uploads/videos with Range support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Video records store url = /uploads/videos/.mp4, but nothing served that path: Next.js only serves static files from public/, so the player's MP4 fallback 404'd and videos were unplayable until HLS transcoding finished. (Thumbnails hit the same problem historically — see scripts/update-thumbnail-urls.ts.) Add a route handler at the exact stored URL so no DB migration is needed. Unlike the HLS route it streams from disk via createReadStream instead of buffering the file, and implements HTTP Range requests (206/416, open-ended and suffix ranges) — browsers require ranges for