tunapanda / h5p-standalone

Display H5P content without the need for an H5P server
MIT License
272 stars 117 forks source link

h5p.instances empty #37

Closed 7Ds7 closed 4 years ago

7Ds7 commented 4 years ago

Hello,

I am not sure if i am missing something obvious with the setup or if it is just not possible, within the current version when i create a new H5p element i can not get the populated instances.

ex: window.H5P.instances is one empty array

I can receive the xAPI events with window.H5P.externalDispatcher, but for events like focus in which i need the instance itself i can not access it.

Shouldn't the window.H5P.instances be populated with the H5P elements that exist on the page?

Jakeii commented 4 years ago

I think this is H5P related not specific to h5p-standalone, but I believe this is happening because the H5P content is rendered inside of an iframe, you'll need to attach event listeners to the iframe.