Repository navigation
v1.1.1
@missing-elements/h5p-offline-player 1.1.1, with @missing-elements/h5p-embed, @missing-elements/h5p-verify and @missing-elements/h5p-normalize at 1.1.0. The runtime, the libraries and cmi5 stay at 1.0.0.
A first play from a host without Range boots in the package's language (#57)
On a host that ignores Range, the content starts before the archive has finished downloading. When h5p.json was not near the start of the archive, the content could start before it had arrived. It then started in the element's language rather than the package's, with no title and no licence metadata. For example, a German package on an English page showed "Fullscreen", and no copyright button. A reload played it correctly.
Now the package's language, title and metadata are saved as soon as h5p.json arrives.
A player no longer keeps a Service Worker registration that has gone (#57)
After the site's data was cleared, another player on the page or in another tab could register the worker again first. The element then kept the old registration, which has no worker once its last page has gone. Every load after that failed with no-worker until the page was reloaded.
The element now uses a registration only when it is its own.
A frame sandboxed without allow-same-origin reports no-worker (#57)
In Chrome and Safari, reading navigator.serviceWorker in such a frame throws an error. The element stopped before its load began and fired no error event. So the embed page showed an empty box instead of its link to open the package in its own tab.
It now fails with no-worker, and the message names the sandbox as a possible cause. Troubleshooting lists it.
A library is never reported as refreshed to a version that is not playing (#58)
This needs a .h5p bundle listed before the pack: libraries="/bundle.h5p pack". A library the package carried, which the bundle also had at the same major version, could play at the bundle's version. Meanwhile libraryBundle.refreshed said it played at the pack's newer one.
Such a library is now not refreshed: the package plays its own copy, and refreshed doesn't list it.
A part of the library pack is used only once its hash has matched (#58)
A downloaded part was marked complete before its SHA-256 was checked against the pack's index. A tab closed between the two left a part with the wrong bytes, which every later load then used as checked. That needs a host serving the wrong file, and a window of milliseconds.
The match is now recorded on the part. A part without that record is checked on its next use, and downloaded again if it fails. That covers both such a part and one kept by an earlier player.
Types under node16 and nodenext (#60)
The player's declarations imported their own files without a file extension. TypeScript's node16 and nodenext resolution can't follow such an import. So for a caller on those settings, types such as PlayerErrorDetail['code'], missingLibraries and ReadyDetail['source'] were any, or an error with skipLibCheck off.
The declarations name their files now. bundler resolution was already fully typed, and the JavaScript is the same code.
@missing-elements/h5p-embed 1.1.0
buildSite()and, from@missing-elements/h5p-embed/embed.js,startEmbed()ship TypeScript declarations:BuiltSiteandEmbedError, andstartEmbed'spackandruntimeoptions typed as the player's own (#60).--packagesnow takes only plain origins, and names a value it refuses when the site is written (#58). Before, a wildcard such ashttps://*.cdn.examplewas written as it was, and the page then refused every package. A value with a quote broke the policy in the files that quote it.- Requires player 1.1.1, so a site written again gets the fixes above.
@missing-elements/h5p-verify 1.1.0
verifyPackage()andsummarize()ship declarations (#60).VerifyReporttypesreport.jsonfield by field, andVerifyErroris public.- With
--untrusted, a removed field namedconstructorortoStringis now reported as removed (#58). Before, it was reported as changed into a built-in function. - Requires player 1.1.1.
@missing-elements/h5p-normalize 1.1.0
normalizeArchive(), formatBytes() and archiveFingerprint() ship declarations, with Report and EntryResult (#60). Nothing else changes.
Upgrading
The fixes are in the element, the Jobs worker and the Service Worker, so update all three:
- On a CDN, change the player's URL to
@missing-elements/h5p-offline-player@1.1.1and copy itsdist/h5p-sw.jsonto your site again. The runtime's URL stays at 1.0.0. - With a bundler, update
@missing-elements/h5p-offline-player. The bundler emits the new workers. - With your own Service Worker that mounts the player (
mountH5P), build and deploy it again. - With copied folders, copy
dist/again. - An embed site: write it again with
npx @missing-elements/h5p-embed@latest <folder> --force, and deploy it.
Full Changelog: v1.1.0...v1.1.1