tunapanda/h5p-standalone

Support Strict Mode

Closed this issue ยท 2 comments

Hi Team! Thank you so much for your awesome work!

I just wanted to make you aware of an issue that I have encountered when I started using your library. I integrated your library, version 3.4.0, into an Ionic 3 app using Angular 5. It works great! However, when you close from full screen, it throws the following error:

Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
    at HTMLDocument.<anonymous> (main.bundle.js:2:118445)
    at t.invokeTask (polyfills.js:3:15660)
    at r.runTask (polyfills.js:3:10834)
    at e.invokeTask [as invoke] (polyfills.js:3:16794)
    at p (polyfills.js:2:27648)
    at HTMLDocument.v (polyfills.js:2:27967)
(anonymous) @ main.bundle.js:2
t.invokeTask @ polyfills.js:3
r.runTask @ polyfills.js:3
e.invokeTask @ polyfills.js:3
p @ polyfills.js:2
v @ polyfills.js:2

I am using ES6. Here is how I set up my viewer in the Angular Component (Ionic Page):

import { H5P } from 'h5p-standalone';

...

/**
  * The h5p viewer
  */
@ViewChild('viewer') viewer: ElementRef;

...

const options = {
    h5pJsonPath: this.item.path,
    frameJs: 'assets/h5p/frame.bundle.js',
    frameCss: '/assets/h5p/h5p.css',
    fullScreen: false,
 };
 new H5P(this.viewer.nativeElement, options);

Not sure if this is something you will address, but thought I should bring it to your attention.

This is an issue in the main h5p library. I sent a pull request, but it hasn't been merged. You can copy over the fix into your main.bundle.js file.

h5p/h5p-php-library#113

๐ŸŽ‰ This issue has been resolved in version 3.6.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€