[FIX] h5p.js:997 Uncaught ReferenceError: H5PIntegration is not defined #167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all,
Since, unfortunately, there is absolutely no documentation about how to develop an H5P editor for a platform integration, I assume to have stumbled upon a bug. If I'm wrong, you guys can gladly point me in the right direction and close this PR.
The problem in question: It is my understanding that you should not initialize the H5P kernel with
H5P.init()
on clientside, if there are no H5P contents. Therefore, if I had merely an H5P Editor on the page, I would assume to only callH5PEditor.init()
to create a new instance of such editor.This lead to an issue for me because the iFrame apparently could not locate the
H5PIntegration
object anymore, which is globally available in its parent window though. Then I realized when initializing H5P contents which are embeded in an iFrame, theH5P.init()
function adds a neat little snippet to the iFrame's<head>
which also solved the problem in the editor for me:This PR introduces the same snippet for the iFrame's
<head>
element when creating a new Editor instance, so theH5PIntegration
object can be found as well. Otherwise, callingH5PEditor.init()
lead to the following two issues:Kind regards,
@thibsy