Repository navigation
verify 1.2.0, cmi5 1.1.0, embed 1.1.1
@missing-elements/h5p-verify 1.2.0, @missing-elements/h5p-cmi5 1.1.0 and @missing-elements/h5p-embed 1.1.1. The player stays at 1.1.1, the runtime and the libraries at 1.0.0, and the normalizer at 1.1.0.
A package address is played only as http or https (#72)
The embed page and startCmi5 now resolve the package address they are given and hand it to the element only as an http or https URL. Any other address plays nothing:
- The embed page refuses a
src=with any other scheme, with "The package address is not an http or https URL." It posts the refusal to the embedding page as anerrorwithcode: 'refused', like its other refusals. Before, adata:URL was taken for another site's package and played untrusted. startCmi5takes the package from thesrcoption, the launch URL's?src=orlaunchParameters, and resolves it against the page's address. An address with any other scheme raises the newunsafe-srcevent, asunsafe-return-urldoes for the return address, and the next source is tried.session.srcis now the absolute address the element was given.
Neither could run script before: the element fetches its src and never navigates to it. The pages now refuse such an address outright, with a message, instead of relying on that.
cmi5 is a minor because unsafe-src is new in Cmi5Event. A switch over the events with no default branch has to handle it.
h5p-verify --preview: the package in the real player, in your browser (#70)
The check says whether a package starts. Whether it is right, a person judges by playing it. --preview checks nothing: it opens the package in the real player in your default browser, served from your computer.
npx @missing-elements/h5p-verify@latest course.h5p --preview- Any content type the player plays, with the same player, runtime and library sources as the check.
--untrusted,--librariesand--no-refresh-librariesmean what they mean for the check. - A large video starts at once. The package is served with
Range, as a static host serves it, so nothing is read whole or extracted to disk. - It ends by itself, ten seconds after its last tab closes, so an agent can start it in the background and leave it. Ctrl+C ends it too.
--no-openprints the address instead of opening a browser.- The check's own options, such as
--outor--json, are refused with--previewrather than ignored. Exit code 2 means the preview could not start.
Also in 1.2.0: given a folder instead of a .h5p, the check stops with Not a file: <path>.
Upgrading
- An embed site: write it again with
npx @missing-elements/h5p-embed@latest <folder> --force, and deploy it. A site gets the new page only when it is written again. - cmi5: update
@missing-elements/h5p-cmi5, and handleunsafe-srcif you switch over the events without adefaultbranch. - The verifier:
npx @missing-elements/h5p-verify@latestruns 1.2.0.
Full Changelog: v1.1.1...verify-v1.2.0