Hello world - manually create package
To get a better insight into the .h5p format you might want to manually create an .h5p file for the Hello World tutorial.
First we define the package itself, add the file "greeting/h5p.json" with the following:
{ "title": "Greeting card", "language": "en", "author": "Tutorial user", "license": "CC BY-SA", "licenseVersion": "4.0", "authors":[{ "name":"The author name", "role":"Author" }], "preloadedDependencies": [{ "machineName": "H5P.GreetingCard", "majorVersion": 1, "minorVersion": 0 }], "mainLibrary": "H5P.GreetingCard", "embedTypes": ["div"] }
Then we insert some content. Add the file "greeting/content/content.json" containing the following json data:
{ "greeting": "Hello world", "image": { "path": "earth.jpg", "width": 300, "height": 300 } }
Also add the image below as "greeting/content/earth.jpg".
Finally, we create a zip file with the content of the "greeting" folder. The tree structure of the zip file should now look like below:
. ├── content │ ├── content.json │ └── earth.jpg ├── H5P.GreetingCard │ ├── greetingcard.js │ ├── library.json │ └── semantics.json └── h5p.json
The greeting folder itself must not be part of the zip file, and for Mac users no .DS_Store files must be included either. See Uploading H5P Packages with OSX for details.
Name this file "greeting.h5p" and upload it using the H5P framework uploader. In Drupal, this is done by creating a new "Interactive content" node, and selecting the "upload" option. In WordPress, go to H5P Content in the admin menu, select Add new and then the Upload option. In Joomla, click the H5P button in the normal article editor and choose "Upload H5P".
Comments
mibarge
Wed, 02/24/2016 - 10:57
Permalink
How to Compress to H5P
Hi.
I've followed this tutorial and the previous Hello World tutorial. But when I upload the H5P files to WordPress I get these errors:
I've checked the contents and they're all as specified in the tutorials.
I also find that if I download a content type and change .h5p to .zip and then edit a file and then repackage as .zip and rename to .h5p, I get the same error.
Can anyone advise what I'm doing wrong?
Thanks.
Martin
falcon
Thu, 02/25/2016 - 15:12
Permalink
Hi, my best guess is that the
Hi, my best guess is that the zip you create has the wrong root folder. Let's say your folder root is "project", and in there you have the library folders, content folder and h5p.json. If you zip the "project" folder you typically will have that folder inside the zip, the root of the zip will contain the project folder. If you instead zip the contents of the project folder your zip will have the content folder, h5p.json and library folder in it's root and should work.
Was this of any help? If not feel free to upload your h5p file here and I'll have a look :)
mibarge
Thu, 02/25/2016 - 17:14
Permalink
Thanks - Got it to work
Hi - thanks for your swift and helpful reply. I've now got it to work, at last! There were two issues:
Now I need to figure out how to stop Mac making those pesky little files.
Thanks for a brilliant platform - H5P is the best interactive multiimedia authoring tool I've seen in years!!
falcon
Fri, 02/26/2016 - 15:14
Permalink
Hi, I'm very glad that the
Hi, I'm very glad that the changes worked for you, and that you enjoy H5P. I really hope that you will consider to share some of your work here on H5P.org in the future. If you haven't shared any of your work before don't be afraid. It doesn't have to be perfect, and others will help you evolve both your projects and yourself in the H5P community :)
vishvesh
Tue, 11/16/2021 - 08:00
Permalink
File "content/" not allowed. Only files with the following exten
Hi,
I have followed the exact steps but still got this error when I tried uploading the package. I use Win10 OS. I confirmed that the root folder contains the library, h5p.json, and the content folder. I am not sure where I went wrong.
vishvesh
Wed, 11/17/2021 - 07:51
Permalink
Hi Falcon, I am trying to
Hi Falcon, I am trying to upload a package but for some reason, I haven't been able to upload it successfully. I zipped the files and not the project root folder.
Moreover, the file that I am trying to upload is an existing working package that I downloaded. I just unzipped and rezipped it.
Following is the error message that I get on the screen:
shazzama
Thu, 05/10/2018 - 00:51
Permalink
Question regarding semantics
Hi, is it possible to manually create a package as in create everything, but not use the semantics.js file? so all the content.json has been filled and is handled by the C.prototype.attach function? How does the semantics. js file works? is it only important for editing and initializing, or is it used for running the actual .h5p file when running on wordpress?
otacke
Tue, 05/15/2018 - 16:08
Permalink
Hi shazzama!You can imagine
Hi shazzama!
You can imagine the semantics.json as a template for content, and content.json holds the values to fill the template with. The semantics file is not only used to build the editor form, but also to check the validity of the content. Everything that's not allowed is filtered out by checking the values from content.json against the structure defined by semantics.json. That's done if you upload content (before it's viewed for the first time) or if you save content.
Best,
Oliver
ch
Fri, 02/01/2019 - 14:43
Permalink
H5P license
When I try to upload the example I get following error message:
> Validating h5p package failed.
> Invalid data provided for license in h5p.json
> The main h5p.json file is not valid
> A valid main h5p.json file is missing
I tested "cc-by-sa", "pd", "MIT" and "U". The only valid "license" is "U" (Unspecified). This applies to both the local H5P installation in Drupal 7 and the version here. What did I wrong?
BV52
Mon, 02/04/2019 - 03:57
Permalink
Hi ch,Did you place the files
Hi ch,
Did you place the files inside a folder in zipped the folder or did you zipped the files altogether? If it is the latter I suggest that share a copy of the file.
-BV52
ch
Mon, 02/04/2019 - 12:51
Permalink
Test Cases
Hi BV52,
thank you for your prompt reply. :) I zipped the files altogether. You can download the test cases here: https://send.tresorit.com/a#XJGnGbLZWGFCQooaomP3hw. The only difference between the two h5p archives is the license field in the h5p.json.
You can also test it by downloading the H5P archive from https://h5p.org/node/885, changing the license in the archive to e.g. "MIT" and try to re-upload it.
Please let me know if you could reproduce this behavior.
icc
Mon, 02/11/2019 - 10:13
Permalink
Hi,This is the license for
Hi,
This is the license for the content and not the code. The only valid options are:
CC BY, CC BY-SA, CC BY-ND, CC BY-NC, CC BY-NC-SA, CC BY-NC-ND, CC0 1.0, GNU GPL, PD, ODC PDDL, CC PDM, U, C
And they are case-sensitive.
clemontrealwebmaster
Wed, 03/20/2019 - 22:07
Permalink
Hi I had the same issue.
Hi I had the same issue. looking at this: https://h5p.org/documentation/developers/json-file-definitions#h5pjson-license
it says
"license"
:
"cc-by-sa"
what worked was:
"license"
:
"CC BY-SA"
as you said in the comment above.Is the documentation page outdated or am I missing something?
BV52
Mon, 03/25/2019 - 04:12
Permalink
Hi clemontrealwebmaster,Thank
Hi clemontrealwebmaster,
Thank you for pointing this out. It seems to be outdated and I've requested for it to be updated here: https://h5ptechnology.atlassian.net/browse/HFP-2696.
-BV52
[email protected]
Mon, 02/11/2019 - 13:44
Permalink
Please help
double post
[email protected]
Mon, 02/11/2019 - 16:29
Permalink
Please help - updated link
Hi I followed Hello world tutorial 1-3 but get these errors when I try to upload to my Bluehost/ Wordpress site:
Validating h5p package failed.
I have used the filestructure outlined above, copied the code from the tuts and have not included a DS_store file. See file below:
h5p file updated link
Hope someone can help, thanks Jorgen
BV52
Tue, 02/12/2019 - 03:32
Permalink
Hi,Did you zip the folder or
Hi,
Did you zip the folder or the files?
-BV52
[email protected]
Tue, 02/12/2019 - 10:06
Permalink
Hi zipped the files - the
Hi zipped the files - the root of my zip looks like this
h5p.json
content (folder)
H5P.GreetingCard (folder)
BV52
Wed, 02/13/2019 - 03:46
Permalink
Hi Jorgen,Thank you for the
Hi Jorgen,
Thank you for the information, I think it is best that this issue is handle here.
-BV52
registration
Tue, 06/25/2019 - 11:00
Permalink
Image not loading
HI, followed these instructions (in Moodle) and all works except the image bundled in to the content folder is not loading (it's showing a broken link instead).
I can manually replace the image through the administration UI but obviously that's not supposed to be necessary.
Is this a known issue? Is there any quick/easy way to debug this? Is there a way I can easily track down the location of where the image actually ends up getting uploaded to (if it does at all) through FTP?
BV52
Wed, 06/26/2019 - 05:34
Permalink
Hi registration,The best way
Hi registration,
The best way to track this down is to check the browser console of any errors.
-BV52
jaime.parada
Tue, 09/15/2020 - 17:12
Permalink
Problems with directories...
Hi,
Thanks for the tutorial... I followed it but, when I tried to upload to moodle, I received the following message:
not-in-whitelist : Archivo "H5P.GreetingCard/" no permitido. Solamente están permitidos archivos con las extensiones siguientes: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt js css.not-in-whitelist : Archivo "H5P.GreetingCard/" no permitido. Solamente están permitidos archivos con las extensiones siguientes: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt js css.not-in-whitelist : Archivo "content/" no permitido. Solamente están permitidos archivos con las extensiones siguientes: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt.not-in-whitelist : Archivo "H5P.GreetingCard/" no permitido. Solamente están permitidos archivos con las extensiones siguientes: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt js css.Could you give a feedback about this? Thanks in advance.
jordicesi
Tue, 01/19/2021 - 12:17
Permalink
como lo solucionaste?
gracias, me pasa lo mismo
diezsiete
Sun, 10/06/2024 - 07:50
Permalink
zip missing flags
you need to add required flags -D (do not add directory entries) and -X (eXclude eXtra file attributes), e.g. as
zip -rDX greeting.h5p *
marinelearning
Fri, 07/05/2019 - 12:01
Permalink
Changes To Library
Hi, I've followed this tutorial, got it to work on my H5P.org account and found that the resulting package even works if I remove the library folder (H5P.GreetingCard) from the package, leading me to assume that the GreetingCard Library is actually preinstalled.
So, out of curiosity, I re-added the library folder and went through my h5p file, renaming every occurrence of the string "GreetingCard" i could find to "EeetingCard": In the h5p.json, library.json, the js and css file, as well as the folder name and so on. When I then tried to upload the resulting .h5p file, it failed with the message "Missing required library H5P.EeetingCard 1.0". However, since the library is provided with the package, shouldn't I be able to use it? If not, how would I be able to actually provide any library I wrote myself, if not with the .h5p package?
StevenDavies
Sat, 12/05/2020 - 05:58
Permalink
Tutorial SO out od Date
Hello, looking at the above it seems that the Tutorial or its instructions are so out of date.
After following all instructions the errors to import into a WP site still exist.
Can you send a ziped h5p for the greeting card that works? So I can study the structure and contents.
Thanks
jordicesi
Mon, 01/18/2021 - 12:48
Permalink
moodle issues
I am using moodle to edit a hp5 video, i download the archive h5p, then I extract the files, then i edit the css and recompres all te files to .zip, then i change back the .zip to .h5p, and then i upload to the moodle, but, an error ocurred: not-in-whitelist : Archivo "content/" no permitido. Solamente están permitidos archivos con las extensiones siguientes: json png jpg jpeg gif bmp tif tiff svg eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt.
This is in the proces to compres the archive back i think, beacause i test many things and i test to do the same that i explained without change nothing and it failed too..
help
thks