Skip to content

h5p-author: a source with media can build, pass the verifier and not play: check a video's and a recording's bytes #218

Open

Description

@alekswebnet

A source without media is held to its fields by the build and played by the verifier. A source with media is held far less: a picture's size is read from its bytes, and nothing else about a file is looked at. This came up on 2026-11-16, when the demo's Interactive Video turned out to have had no sound since it was made: its clip has no audio track, and no tool said so.

Tested

On 2026-11-17, with author 0.10.3: an Interactive Video whose path is http://…/wiki/File:clip.mp4, an address that answers with an HTML page (text/html, 86 bytes), and one interaction from 500 to 600 s.

  • h5p-author build says Built … 1 media file and stores the page as content/videos/File-clip.mp4. The address ends in .mp4, and #download in media.mjs takes the type from the name before what the server says it is. A Wikimedia Commons file page and a Dropbox share link (…/clip.mp4?dl=0) are addresses of this kind. A picture at such an address is refused, since its size cannot be read.
  • h5p-verify says pass … ready in 0.31 s. Its screenshot shows "Video format not supported.", so only someone who looks at the picture learns it.
  • The interaction at 500 s is not reported. The type file says "Know the video's length, and keep every time within it", and the build does not know the length.

What to change, most useful first

  1. The build reads a video's and a recording's first bytes, as it reads a picture's. mp4 and m4a (ftyp), WebM (EBML), Ogg (OggS), MP3, WAV. A file that is none of what its field takes is a problem, as a picture whose size cannot be read is. In Node and on the build page alike, through MediaAccess.open.
  2. For an mp4 the build reads the index (moov) too: tracks, codecs, length. The normalizer's mp4-faststart.mjs already walks these atoms, so this reuses it. Then:
    • an Interactive Video's time (an interaction, a bookmark, the summary) past the video's end is a problem;
    • no audio track is a line in the build's output ("the video has no sound"), not a problem, since a silent video can be meant;
    • HEVC (hvc1, hev1), which Chrome and Firefox do not play everywhere, and a video with no video track: a problem or a warning, to decide.
  3. The verifier says when media cannot be played. After ready, a <video> or <audio> in the frame with an error (MEDIA_ERR_SRC_NOT_SUPPORTED) fails the run, or at least stands as a warning beside pass. To check first: what headless Chromium cannot decode that a person's browser can.
  4. A YouTube or Vimeo address is checked to exist, where the network is there. The build holds an address to its shape only, so a made-up id builds and shows a dead player. Both hosts have an oEmbed endpoint that should answer with an error for a video that is not there (not tried yet). Skipped where nothing can be fetched.
  5. The build page moves an mp4's index to the front. It does not now (design/author.md: "that is the normalizer's, which runs in Node"), so a phone's video built there can start only once it has arrived whole. mp4-faststart.mjs reads only moov into memory; to check whether it can run on a Blob, exported as ./crc32 is.
  6. Runs that were never made: Haiku building from a picture or a video attached in a chat's sandbox, routes 1 to 3. design/author.md records that none of the runs so far named a file.

Not solved by a check: the model does not see the media

In Interactive Video, Image Hotspots, Find the Hotspot and Game Map the model writes times and positions for a video or a picture it has not looked at. Item 2 gives it the length. For positions, to decide: a command that prints what a file is (length, size, sound) before the source is written, or a line in those type files saying to look at the picture where the chat can.

Left as it is

HEIC, WebP, SVG and MOV are refused with a message listing what the field takes. That is H5P's own list.

Activity

  1. alekswebnet commented on Nov 20, 2026

    @alekswebnet
    ContributorAuthor

    Where this stands, 2026-11-20:

    Items 4 and 5 go out with author 0.15.0 and normalize 1.5.0.

  2. self-assigned this
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions