Development environment


When I change library folder to h5p-mylibrary I get Unable to find constructor for: h5p-myibrary 1.0 with the machine name h5p-mylibrary. When the machine name is H5P.MyLibrary and the folder is h5p-mylibrary or H5P.MyLibrary. I get /h5peditor/cd0a54d5e6147/0/libraries/H5P.MyLibrary/1/0 - No such file or directory. This doesn't make sense, so why doesn't H5P.MyLibrary work when its in sites/default/files/h5p/development ?
Am I missing something?

With these tree files placed in an "H5P.MyLib" folder in Drupal's H5P development folder you should be able to create "MyLib" content.

Do I add libraries before or after?

Go to the H5P settings page and enable "H5P development mode" and "H5P development directory"

Do I put them in sites/default/files/h5p/development? The library i'm working on requires a few libraries.

thomasmars's picture

Make sure "H5P development directory" is activated in H5P settings. Remove any version you have installed of this library, as the version may be interfering with your development folder library, H5P will use the latest version you have available on your system. Make sure the machine name is the same as the class definition in your JavaScript and make sure you have defined a valid semantics.json and library.json in your library folder (h5p-mylibrary or similar) in the development folder.

Also I would advice you to try to get up the development folder directory before adding any dependencies, just to see that your setup is working first before introducing unnecessary complexity.