feat(author, mcp): a file's facts before a source names it, and a note for what only a look can check (#260, #266)
For five content types a source holds numbers that mean something only against a file: an Interactive Video's times, and the places of hotspots, areas and stages on a picture. This gives a model the facts a tool can read before it writes them, and has the build say plainly what nothing but a person's eyes can check.
What changes
h5p-author media <file or address>…says what a file is before a source names it: a picture's size, an mp4's length and whether it has sound, a Vimeo video's length as Vimeo gives it. It reads with the readers a build already holds a source's files to, and needs no libraries.describeMediaandmediaLineare the same from code.h5p_media, a fifth tool of the local MCP server, is that command for an app with no shell. It reads only in the server's folders and answers in words alone.- Vimeo's length holds an Interactive Video's times, as a file's does. Its answer carries the length in whole seconds, so a time is refused only a second past it, and the problem says whose word the length is. YouTube says none.
- A build says the length it held the times to:
result.lengths, a line of the command's output and of both servers' answers. - A build notes what is placed or timed by numbers alone, one note for each such list: "holds 5 hotspots placed by numbers, which a build cannot hold to the picture: look at each in the preview". The skill already passes a build's notes on.
- The skill names
mediawhere a file is written, by route. The Interactive Video file says to read the length first, and that a text over a video is H5P.Text. The Image Hotspots file says a hotspot's position is its centre (read in the library's stylesheet).
Measured, 2026-11-25
Claude Code stood in for a chat with a code sandbox: the skill installed, the file attached, npm cut off for real on routes 1 and 3. Two test files: a picture of five small shapes at known places, and a 10 s mp4.
#266, today's skill and tool (16 runs: Haiku and Sonnet, two tasks, routes 1 to 3, and four with a picture named only by its path).
| What was recorded | Result |
|---|---|
| Built | 16 of 16, 14 at the first build |
| The attachment found and named | 16 of 16 copied it beside the source and named it by its name; none by a made-up path |
| The build's line said "1 media file" | 16 of 16 |
| Verifier, where npm answered | passed in 8 of 8 |
| Hotspots on the shape they name | 5 of 5 in every run, within one percent |
| A picture named only by its path was opened first | 4 of 4 |
| A time past the video's end | none written: every one of the 6 video runs first wrote an mp4 parser of its own to learn the length |
The two runs that lost a round: an Interactive Video's text written as H5P.AdvancedText (fixed here in the type file), and a bundle unzipped into parts/, which left its index at parts/parts (not changed here).
#260, before and after.
| Before | After | |
|---|---|---|
| Video, routes with a shell: how the length was learned | a parser of the model's own, 6 of 6 runs | media, and no parser, 4 of 4 runs (route 1) |
| Video, MCP tools only (Haiku): builds needed | 2 in 3 of 3 runs; two left a first package whose question started as the clip ended | 1 in 3 of 3 runs, h5p_media called first |
| The reply says the places or times are unchecked, or asks to check them | 6 of 16 runs | 8 of 8 runs |
So the three things #260 proposed first are built (A, B and E). Its other options are not:
- C, a grid over the picture. Shown the picture, both models placed all five hotspots within one percent in 14 of 14 runs with no grid, so it is not built. Other chats' models were not measured.
- D, asking for a video's moments. Not built: it costs the one question the skill may ask.
Behaviour that changes
- Every build of Image Hotspots, Find the Hotspot, Find Multiple Hotspots, Game Map and Interactive Video now carries one note. A caller that expected no notes for these types sees one.
- An Interactive Video on Vimeo with a time more than a second past the length Vimeo gives is now refused; it built before.
MediaStore.lengthOfreturns{ file, seconds, host }, not a number (internal).
Tests
- Author: 297 pass, type check clean. New:
mediaon files, hosted videos, refusals, confinement and the command's exit code; Vimeo's length, its one second of slack and four answers that say no length; the notes for each type; the length line. - MCP: 46 pass, type check clean. New:
h5p_mediain and outside its folder, and the length line in a build's answer. - Skills: 82 pass. Every type file's example still builds with no note but the two expected ones.
Not verified
- Route 2 (
npx) and route 3 could not run the new command before a release: only route 1, with an archive built from this branch, and the MCP server were run. The baseline covered all three routes. - No chat app was tried, only Claude Code as a stand-in, and only Claude models.
mediaon a real WebM, Ogg, WAV or MP3: their length is not read, by design.
Release
Author and MCP each need a minor: media, describeMedia, lengths and h5p_media are new. The skill names media, so the organisation's site should pin the new author release soon after: until then its archive and one-file tool answer "unknown command", and a model falls back to what it does today.
Summary by cubic
Closes #260 and #266. Adds a way to read a file's facts before a source names them, and makes a build say what only a person can check: a hotspot's place and a video's times.
What changes
h5p-author media,describeMediaandmediaLinereport a picture's size, an mp4's length and sound, and a Vimeo video's length as Vimeo gives it, with the readers a build holds a source's files to and nothing extra to install. A web address with no extension served asaudio/oggoraudio/webmis read too, and downloads are kept one at a time, however many are named.- The MCP server grows a fifth tool,
h5p_media, for an app with no shell; it reads only inside the server's folders and refuses a blank file name. - An Interactive Video's times are now held to Vimeo's length as well as a file's, letting a time pass only one second beyond it; YouTube still gives no length.
- A build's result carries
lengths, and the command line and both servers say each, so the next writer starts from it. - Builds now add one note per list of hotspots, areas, stages, or interactions placed or timed by numbers, saying to look at them in the preview; bookmarks, end screens, and names not the table's own are not noted.
- The skill names
mediawhere a file is written; it says to look at the picture where a model can see one, that a legacy hotspot's position is its top left, and that a text over a video is H5P.Text. Wheremediagives no length, the user's own length is taken and the reply says the times were not checked against it.
Behavior and release
- Every build of Image Hotspots, Find the Hotspot, Find Multiple Hotspots, Game Map and Interactive Video now emits one note; callers expecting none for these types will see it.
- An Interactive Video on Vimeo with a time more than a second past the length Vimeo says is now refused, where it built before.
MediaStore.lengthOfnow returns{ file, seconds, host }, not a number (internal).- Author and MCP each need a minor release for the new
media,describeMedia,lengthsandh5p_media; the skill callsmedia, so the organisation's site should pin the new author release soon after, or its archive and one-file tool answer "unknown command".