H5P Guides

Specify the library metadata

An H5P library needs to specify some metadata, so the various modules know how to identify it. This is done in the library.json file.

Create the file greeting/H5P.GreetingCard/library.json containing the following:

{
  "title": "Greeting card",
  "description": "Displays a greeting card",
  "majorVersion": 1,
  "minorVersion": 0,
  "patchVersion": 0,
  "runnable": 1,
  "author": "Amendor AS",
  "license": "cc-by-sa",
  "machineName": "H5P.GreetingCard",
  "coreApi": {
    "majorVersion": 1,
    "minorVersion": 0
  },
  "preloadedJs": [
    { "path": "greetingcard.js" }
  ],
  "preloadedCss": [
    {"path": "greetingcard.css"}
  ]
}

This identifies the library as "Greeting card". The specified machineName will be used internally, and should match the folder name of the library.

The preloadedJs option preloads your javascript file. This file is responsible for the display of your content, and will be defined in a later section.

Note that the patchVersion needs to be increased between uploads, unless the H5P framework is set in "Development mode". If the patchLevel matches (or is lower than) the currently installed version, it will not be installed.