Issue #3620148: Add the media video and file shapes

A video reaches a front end as two facts - where to play it from and how long it runs - and a file as four: where it is, what to call it, how big it is and what it is. The second pair is what lets a page say "PDF, 2.4 MB" before anybody clicks, and the duration is what a player needs before it has loaded anything, which is why neither is a file with a different mime type.

A media type holds its video either as an uploaded file or as an address at some other service, and both are answered with the same fragment. The duration is read out of the file, so a video that is not a file has an empty one rather than a missing key: a player reading it asks how long, and "not known" is an answer to that. Reading it at all needs the getID3 library, which this project suggests rather than requires, so its absence answers with an empty duration instead of a fatal error on every page carrying a video.

Neither shape answers with a stub. A file whose entity was deleted is left out of the list, and a media item whose file was deleted from under it produces no key at all - an address that leads nowhere would be drawn by a front end as a download that fails when it is used.

Two things both shapes needed are in the base rather than in them. Turning fragments into an answer - nothing, one, or a list, with the single setting overriding the cardinality - is a decision every multi-value shape has to make, and making it twice is how two shapes come to make it differently. Resolving a media reference and asking its source plugin where the value is kept is the other; the media image shape from the previous issue now uses it too.

Closes #3620148

Merge request reports

Loading