feat(author): a page's build leaves a video at its address, for a preview with no download first (#263)
A page's build can now leave a video or a recording where it is and play it from there, so a large video plays at once and is not downloaded first.
What changes
buildPackageof@missing-elements/h5p-author/browsertakeslinked: an object or aMapof the names a source gives its files and the http(s) address each is played from.- A video or a recording named so is written into the content by its address, as a YouTube video is, with the type its name says. None of its bytes are read.
- The result's
linkedlists those names. With one in it the package is a preview, not a file to keep: the address may stop answering. - A file given in
filesunder the same name goes before the address. That is how the package to keep is built, as today. - Refused, each with a problem at its path: a picture or another file left at an address, a name its field does not take, an address that is not http(s). The address itself is in no problem, since one that lets a file be read is not for a log.
Nothing changes for a build that passes no linked. The Node build does not take the option.
Not checked for a file left at an address
Its container, its tracks, and an Interactive Video's times against its length. Those checks need the bytes and come with the build that copies the file.
Testing
tests/page.test.ts, in Node: the content takes the address, nothing is fetched, no media entry is in the package, a file given goes before the address, and the three refusals.tests/browser/page.test.ts, in Chromium: a package with a video left at an address is played by the verifier untrusted, from a server of another origin that sends no CORS header. The verdict ispass, the content check changes nothing, and the server gets the player's request for the file in parts (bytes=0-).- The author package's Node tests: 283 passed. Its browser tests: 3 passed.
pnpm typecheckinpackages/authorpasses.
Measured before this, 2026-11-23
One 230 MB video (1080p, 151 s) attached in a ChatGPT chat, reached by the link ChatGPT gives for it: 9 min 13 s to download and build before it played; 1.4 s when the browser played it straight from the link.
Not verified
- No run in a chat app yet with this build: that needs a release of the author package and the org site's play page using
linked, which is the next step. - Only Chromium ran the browser test here.
Release
An added option and an added field of the result: a minor version of @missing-elements/h5p-author.
Summary by cubic
A page's build can now leave a large video or recording at its web address and play it from there, skipping the download and build time before playback. buildPackage of @missing-elements/h5p-author/browser takes a linked option mapping source names to http(s) addresses.
- None of the file's bytes are read, so nothing about it is checked.
- A video starts at once where the address answers a request for a part of the file (HTTP
Range); elsewhere it plays as bytes arrive. - The result's
linkedlists those names: a package with one is a preview, not a file to keep, since the address may stop answering. - A file given under the same name goes before the address, which is how the package to keep is built.
- Only a video or a recording can be left at an address. Pictures, other types, non-http(s) addresses, and addresses on YouTube, Vimeo, Panopto or Echo360 — which the source names itself — are refused, each with a problem at its path that never quotes the address.
- Builds with no
linkedare unchanged, and the Node build does not take the option.