How to resolve dependancy failures between H5P core assets?
I'm trying to integrate H5P into a custom platform. I could really use some advice on a couple of problems I'm faciing.
The platform is an Single Page Application, where I'm only loading the H5P assets as-needed (in the browser). The problem I'm seeing is that the dependancies between the various H5P assets is complex. I found early on that I had to make all the <script> tags synchronous (async = false), or h5p.js would not load becase H5P.jQuery wasn't defined, etc., etc.
Is the order of browser-side loading of the assets important? Seems like there are many case where timing problems cause grief.
The problem I'm fighting now is H5P.init() is failing for a content-type (Blanks) because the cached-asset containing H5P.Blanks has not loaded yet. It's a timing issue because sometimes it works, and other times it does not.
So I can conceptually get dependancies to resolve it I load .js in this order:
Is this a good approach, or is there other infrastructure somewhere in H5P that might help me with loading the core assets properly?