feat(media): @shade/media/worker puts the media handler in an app's own Service Worker

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-20 00:13:50 +02:00
parent 6f67bad97e
commit bc7cb85682
5 changed files with 216 additions and 139 deletions

View File

@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- **`@shade/media/worker`: Shade's media handler inside an app's own Service
Worker.** A worker answers every request of the pages it controls, so an
installed PWA with a worker at `/` never let `media/<id>` reach Shade's
worker beside it. `installShadeMedia(self)`, `isShadeMediaRequest(req)` and
`shadeMediaResponse(req)` put it in the app's worker instead. The standalone
`browser/sw.ts` is now a thin wrapper around the same module.
- **`media put` records length and picture size.** Video, audio and images
are measured with ffprobe (after `--web`, so the numbers match the sealed
file) and sealed with `durationMs`, `width` and `height` in their meta. A