the contentId which needs to be saved; can be undefined for new content, which hasn't been saved before
the data needed by the server; usually encoded as JSON string and sent to the server
the newly assigned content id and metadata
Called when the component needs to load data about content. The endpoint called in here combines the results of H5PEditor.render(...) and H5PEditor.getContent(...) to avoid too many requests.
Note that the library, metadata and params property of the returned object must only be defined if contentId is defined.
Should throw an error with a message in the message property if something goes wrong.
Static
observedIndicates changes to which attributes should trigger calls to attributeChangedCallback.
Called when one of the attributes in observedAttributes changes.
Called when the component is added to the DOM.
Called when the component is removed from the DOM.
Call this method when the iframe containing the editor needs to be resized, e.g. because the some
Call save() to get data from the H5P editor and send it to the server. You can use the saveContentCallback hook to customize server requests. The component emits 'saved', 'save-error' and 'validation-error' events, depending on success of the function. You can subscribe to those or use the promise's return value and catch the errors in a try-catch block.
the contentId and metadata of the saved content
Called when the component needs to save data about content. The endpoint called here should call H5PEditor.saveOrUpdateContentReturnMetaData(...). Note that it makes sense to use PATCH requests for updates and POST requests for new content, but it's up to you how you implement this. See defaultSaveContentCallback for an example.
Should throw an error with a message in the message property if something goes wrong.