preloadedDependencies are not installing automatically for custom H5P content type
Submitted by arun.ak on Tue, 04/11/2023 - 13:12
{
"title": "Video Game",
"description": "Custom video game.",
"majorVersion": 1,
"minorVersion": 0,
"patchVersion": 0,
"runnable": 1,
"author": "Arun AK",
"license": "MIT",
"machineName": "H5P.VideoGame",
"preloadedJs": [
{
"path": "video-game.js"
}
],
"preloadedCss": [
{
"path": "video-game.css"
}
],
"preloadedDependencies": [
{
"machineName": "H5P.Video",
"majorVersion": 1,
"minorVersion": 6
}
],
"editorDependencies": [
{
"machineName": "H5PEditor.Wizard",
"majorVersion": 1,
"minorVersion": 2
}
]
}
"title": "Video Game",
"description": "Custom video game.",
"majorVersion": 1,
"minorVersion": 0,
"patchVersion": 0,
"runnable": 1,
"author": "Arun AK",
"license": "MIT",
"machineName": "H5P.VideoGame",
"preloadedJs": [
{
"path": "video-game.js"
}
],
"preloadedCss": [
{
"path": "video-game.css"
}
],
"preloadedDependencies": [
{
"machineName": "H5P.Video",
"majorVersion": 1,
"minorVersion": 6
}
],
"editorDependencies": [
{
"machineName": "H5PEditor.Wizard",
"majorVersion": 1,
"minorVersion": 2
}
]
}
When I try to install my custom content type VideoGame.h5p file the editor shows error for missing 'Video' library.
How to configure to install preloadedDependencies automatically when upload a custom H5P library?
otacke
Tue, 04/11/2023 - 15:08
Permalink
Hi!If your platform doesn't
Hi!
If your platform doesn't host the Video library in version 1.6 already, you will need to bundle it with your custom content type. That's what the `-r` option of the H5P CLI tool is for when packing a library. Otherwise, H5P will not install your content type, because it cannot fulfill the dependencies.
Best,
Oliver
arun.ak
Tue, 04/11/2023 - 18:44
Permalink
Issue with folder structure
It seems some issue with the folder structure.
My project is here ~/PhpstormProjects/h5p/video-game
and I cloned https://github.com/h5p/h5p-video.git inside 'video-game' folder.
Then packed using command h5p pack -r video-game h5p-video vg1.h5p
Attached a screenshot of my folder structure.
Then when upload the package(vg1.h5p) in the editor, getting following error.
Validating h5p package failed.
otacke
Tue, 04/11/2023 - 19:14
Permalink
The `h5p-video` folder needs
The `h5p-video` folder needs to be in the same folder as your `h5p-video-game? folder, not inside the latter. Just like any other dependency that you may require. One is essentially packing from what would be the `library` folder of an H5P integration.
otacke
Tue, 04/11/2023 - 19:15
Permalink
Oh, and when you upload that,
Oh, and when you upload that, do NOT upload it on the H5P Hub which is meant for content files, not for plain libraries. The H5P library setting screen is meant for uploading mere libraries.
arun.ak
Wed, 04/12/2023 - 10:35
Permalink
I am not uploading to H5P Hub
I am not uploading to H5P Hub. I am trying to upload in to my Drupal 9 website's H5P editor.
I updated the folder structure as mentioned, but still getting same error.
Validating h5p package failed.
otacke
Wed, 04/12/2023 - 11:53
Permalink
What you call H5P Editor is
What you call H5P Editor is the H5P Hub.
Drupal has an H5P library settings page (Content => H5P Libraries) that is supposed to accept mere library files that do not contain content.
arun.ak
Wed, 04/12/2023 - 11:38
Permalink
tried to unzip .h5p file by
tried to unzip .h5p file by renaming it, then there are only two folders
H5P.VideoGame and H5P.Video
the content folder and h5p.json files are missing.
But package upload is working fine if I pack my library alone using below command
zip -rDX videoGame.h5p *
But it does not include H5P.Video library.
otacke
Wed, 04/12/2023 - 13:36
Permalink
tried to unzip .h5p file by
Hihi, does Windows still try to determine the file type by extension only :-D
That's perfectly fine. There's nothing missing if you're not expecting content files. You can upload that H5P library file on the H5P library settings page.
One should not zip manually, but I guess you've read that comment of mine here before.
You're zipping an videoGame.h5p file. That does not make sense at all. Please just stick with the H5P CLI tool.
What are you creating by the way? Anything that the H5P community can see soon?
Best,
Oliver
arun.ak
Thu, 04/13/2023 - 12:45
Permalink
That's perfectly fine. There
But without content folder and h5p.json file I am not upload the file into Drupal H5p editor.
BV52
Thu, 04/13/2023 - 13:07
Permalink
Hi arun.ak,This is why Oliver
Hi arun.ak,
This is why Oliver has suggested that you upload it in the library settings instead of the Hub/H5P editor. Refer to his comments.
-BV
otacke
Thu, 04/13/2023 - 15:37
Permalink
Hey all! Yes, kind of running
Hey all! Yes, kind of running in circles :-D
And I am still interested: What are you creating? When will the H5P community get something to play with?