H5P is not defined when using xapi

Forums: 

Is anyone else having this issue. I just can not get it to register when doing:

H5P.externalDispatcher.on('xAPI', function (event) {

  console.log(event.data.statement);

});

otacke's picture

Hi Yuri!

Well, you can easily check in the browser's development console on any of the example pages that this is working. What context are you running that in?

Best,
Oliver

We are running n h5p activity created in Lumi editor. So we are not utilizing the H5P cloud service or running our own server. Lumi creates a standalone file and I am concerened that maybe it does not have the xAPI available

otacke's picture

Hey!

I know Lumi :-) It doesn't artificially strip away any xAPI functionality when you export content to HTML and works just fine as you can see in the screenshot. Hence my question about the context that you're trying to access the `H5P` object. Does it exist from where you're trying to access it?

Best,
Oliver