From fd15628393c5c02c29df86e6454c1226bd2e6a35 Mon Sep 17 00:00:00 2001 From: sravan Date: Wed, 22 Jul 2026 22:09:32 +0530 Subject: [PATCH] feat(video): server-generated poster thumbnails + HTTP Range streaming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dockerfile: add ffmpeg (Alpine). - static.js: new /thumbs/ — ffmpeg extracts the first frame (0.5s), caches it next to the file, serves as the video poster (cosmetic; 404s gracefully if ffmpeg unavailable). - static.js: /files now supports HTTP Range (206 Partial Content) + Accept-Ranges, which iOS requires to stream/seek video reliably (fixes the buffer-before-play / multi-tap); media (image/video/audio) now served inline, other files still download. Shared attachment auth refactored into one helper used by /files and /thumbs. - home.html: video poster points at /thumbs/. build batch157. Co-Authored-By: Claude Opus 4.8 --- Dockerfile | 3 ++ server/public/home.html | 4 +-- server/static.js | 65 ++++++++++++++++++++++++++++++++++------- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28859c2..ae92cbd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ # Node 24 ships node:sqlite as a stable built-in (no flag), which db.js relies on. FROM node:24-alpine +# ffmpeg: server-side video poster thumbnails (see static.js /thumbs/). Small on Alpine. +RUN apk add --no-cache ffmpeg + ENV NODE_ENV=production WORKDIR /app/server diff --git a/server/public/home.html b/server/public/home.html index 13b04b7..9050c3d 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -1162,7 +1162,7 @@ -