mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-16 14:27:26 +00:00
* fix(studio-server): more than six clips on one media file no longer starve check and preview of connections Every file server answered `Range: bytes=N-` with the rest of the file. A media element reads that until its buffer is full, then stops reading but keeps the response open, so each <video> held one of Chrome's six HTTP/1.1 connections to the host. With seven or more <video> clips on the server's host, every other request queued behind them and `hyperframes check` stalled at 0% CPU. A long recording cut into trimmed segments, each its own <video> on the same file, is enough. An open-ended range of audio or video now gets at most 4 MiB (OPEN_MEDIA_RANGE_BYTES), as a normal 206 with an exact Content-Range. The element asks for the next range as it plays or seeks. Bounded and suffix ranges, and files that aren't media, are served as before. The helper lives in studio-server; its preview route and the CLI's static project server and composition server use it. Fixes #6029 Claude-Session: https://claude.ai/code/session_014aw1z3VrTNenka3LGDBBLa * fix(studio-server): carry the range cap's reason in names and tests, not comments The comment ratchet doesn't let a file's comment share rise: mediaRange.ts was 48% comments against the package's 7%, and staticProjectServer.ts gained a line. The cap is now MAX_OPEN_MEDIA_RANGE_BYTES, and the why and the repro stay in the three tests and #6029. Claude-Session: https://claude.ai/code/session_014aw1z3VrTNenka3LGDBBLa * fix(producer): the render file server bounds open-ended media ranges too parseRangeHeader takes the response's content type and caps an open-ended `bytes=N-` on audio or video with openRangeEnd, like the CLI and Studio servers. The producer imports it from a new `media-range` subpath of @hyperframes/studio-server, as it does `encoder-options`, so a render doesn't load the rest of the package. Claude-Session: https://claude.ai/code/session_01DW4V8HZZx5JUgMffb3juVV * test(cli): eight clips on one file no longer leave the host unanswered A real Chromium page buffers eight long video clips of one file from the project server and then asks the same host for another file; with open-ended ranges unbounded the request stays unanswered, with the bounded piece it is answered at once. * docs(producer): range comments name the open-ended form in lowercase * docs(cli): the range test's comment says what holds now --------- Co-authored-by: HuntsDesk <hunter@talloak.com>