pressbooks / ideas

Ideas for Pressbooks.
GNU General Public License v3.0
12 stars 4 forks source link

Allow remotely-hosted H5P activities (from *.h5p.com) to be embedded using a shortcode #164

Open greatislander opened 5 years ago

greatislander commented 5 years ago

Feature Description

H5P activities can be created in Pressbooks. They can also be created on the H5P.com SaaS platform and embedded using an iframe and a companion JavaScript file, e.g.:

<iframe src="https://<subdomain>.h5p.com/content/<id>/embed" width="1088" height="637" frameborder="0" allowfullscreen="allowfullscreen" allow="geolocation *; microphone *; camera *; midi *; encrypted-media *"></iframe><script src="https://<subdomain>.h5p.com/js/h5p-resizer.js" charset="UTF-8"></script>

Pressbooks doesn't support this because script tags are not safe for inclusion in editor content and are always removed. We could whitelist the iframe but not the script tag. Instead, we should create a shortcode, e.g.:

[remote-h5p src="https://<subdomain>.h5p.com/content/<id>"][/remote-h5p]

The shortcode would create the iframe and embed a (local) version of the accompanying script.

Feature Use Case

This will allow users who are creating H5P activities externally to embed them in Pressbooks, which is currently not possible.

Other Notes

N/A.

System Information

Pressbooks: 5.7.0-dev

gunha commented 5 years ago

Over here at UW-Madison we've received a number of requests to allow h5p activities to be embedded from h5p.com and h5p.org. It would be great if this idea could be included in a future release soon!

Thanks!

Andrew