@missing-elements/h5p-embed 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/bin/h5p-embed.mjs +2 -2
- package/lib/build.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -11,12 +11,13 @@ Deploy it to any static host, then embed:
|
|
|
11
11
|
|
|
12
12
|
```html
|
|
13
13
|
<iframe src="https://h5p-player.example.net/?src=https://cdn.example.org/course.h5p"
|
|
14
|
-
allow="fullscreen" style="width: 100%; border: 0"></iframe>
|
|
14
|
+
allow="fullscreen; microphone; camera" style="width: 100%; border: 0"></iframe>
|
|
15
15
|
<script src="https://h5p-player.example.net/resizer.js"></script>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
The script sizes the iframe to the content; a page that already loads h5p.org's `h5p-resizer.js`
|
|
19
|
-
needs no second one.
|
|
19
|
+
needs no second one. `microphone` and `camera` are for Audio Recorder, Speak the Words and AR
|
|
20
|
+
Scavenger: a frame from another site gets neither unless the page allows it.
|
|
20
21
|
|
|
21
22
|
**Use a separate registrable domain** — `h5p-player.example.net`, not `h5p.example.com` — and put
|
|
22
23
|
nothing else on it: no accounts, no cookies. A package is JavaScript and runs as that origin, and
|
|
@@ -29,7 +30,7 @@ a subdomain shares your site's cookies.
|
|
|
29
30
|
| `--packages <origins>` | Play packages and fetch library bundles only from these origins (the site's own is always allowed). Add `https://cdn.jsdelivr.net` for `libraries=pack` on a site built with `--no-libraries`. Default: any https host |
|
|
30
31
|
| `--ancestors <origins>` | Only these sites may frame the page (`frame-ancestors`, header only). Default: any site |
|
|
31
32
|
| `--default-libraries <sources>` | The `libraries` value for addresses that name none: `pack` or URLs. Checked against `--packages`. Default: none, so exports without libraries are refused unless the address asks |
|
|
32
|
-
| `--no-libraries` | Leave out the
|
|
33
|
+
| `--no-libraries` | Leave out the 13.7 MB library pack; `libraries=pack` then fetches it from jsDelivr, where allowed |
|
|
33
34
|
| `--force` | Write into a non-empty folder, replacing only this tool's files |
|
|
34
35
|
| `-h`, `--help` / `-v`, `--version` | |
|
|
35
36
|
|
package/bin/h5p-embed.mjs
CHANGED
|
@@ -20,7 +20,7 @@ Options:
|
|
|
20
20
|
the libraries= value for addresses that name none, so a snippet without
|
|
21
21
|
it still plays an export with no libraries: pack or URLs, as the
|
|
22
22
|
parameter. Default: none, such exports are refused unless the address asks
|
|
23
|
-
--no-libraries leave out the
|
|
23
|
+
--no-libraries leave out the 13.7 MB library pack; libraries=pack then fetches it from jsDelivr
|
|
24
24
|
--force write into a folder that is not empty, replacing only this tool's files
|
|
25
25
|
-h, --help show this
|
|
26
26
|
-v, --version print the version`
|
|
@@ -80,7 +80,7 @@ try {
|
|
|
80
80
|
Deploy the folder to a domain that holds nothing else — a separate registrable domain, not a
|
|
81
81
|
subdomain of your site — then embed a package:
|
|
82
82
|
|
|
83
|
-
<iframe src="https://<player domain>/?src=<package url>" allow="fullscreen"
|
|
83
|
+
<iframe src="https://<player domain>/?src=<package url>" allow="fullscreen; microphone; camera"
|
|
84
84
|
style="width: 100%; border: 0"></iframe>
|
|
85
85
|
<script src="https://<player domain>/resizer.js"></script>
|
|
86
86
|
|
package/lib/build.mjs
CHANGED
|
@@ -184,7 +184,7 @@ ${libraries ? ` libraries.h5p @missing-elements/h5p-libraries, the H5P hub'
|
|
|
184
184
|
` : ''}
|
|
185
185
|
Serve it from a domain that holds nothing else, and frame it:
|
|
186
186
|
|
|
187
|
-
<iframe src="https://<this domain>/?src=<package url>" allow="fullscreen"
|
|
187
|
+
<iframe src="https://<this domain>/?src=<package url>" allow="fullscreen; microphone; camera"
|
|
188
188
|
style="width: 100%; border: 0"></iframe>
|
|
189
189
|
<script src="https://<this domain>/resizer.js"></script>
|
|
190
190
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@missing-elements/h5p-embed",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Self-hosted H5P embeds: writes the H5P embed page as a static site for a player domain of your own, then any site frames it with an iframe and one script line. No H5P server, no third-party service; optional allowlists for package hosts and embedding sites.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"cli"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@missing-elements/h5p-libraries": "^0.
|
|
47
|
-
"@missing-elements/h5p-offline-player": "^0.
|
|
48
|
-
"@missing-elements/h5p-runtime": "^0.2.
|
|
46
|
+
"@missing-elements/h5p-libraries": "^0.2.0",
|
|
47
|
+
"@missing-elements/h5p-offline-player": "^0.9.0",
|
|
48
|
+
"@missing-elements/h5p-runtime": "^0.2.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^26.6.4",
|