H5P fails on Android Moodle App or browser

H5P fails on Android Moodle App or browser

by Craig Limacher -
Number of replies: 7

Moodle App nor browser can not load any H5P activities on any of my courses on my server if using an Android device. It works fine on

  • any Apple iOS devices, and
  • when running all other required exercises other than H5P content.

Error returned by the app is in the "web page" of the application returning ERR_BLOCKED_BY_RESPONSE error message (first image)

Copying the URL on the error screen to open another instance of the H5P exercise in a browser creates a H5P screen and a message (no hyperlink) to login (second image)

We've upgraded Moodle to 4.5 and I have upgraded all the plugins as well (I read on a different site this resolved an issue for a different person)

We have registered with Moodle App regular (not Pro) 

Any advice on settings, debugging, administration settings, or just "throw a hammer at it and see what happens" suggestions welcome.

Attachment MoodleError-001.jpeg
Attachment MoodleError-002.jpeg
Average of ratings: -
In reply to Craig Limacher

Re: H5P fails on Android Moodle App or browser

by Craig Limacher -
Hi guys, sorry to bump this but I am still encountering issues and at a loss to explain this, can anyone help?
In reply to Craig Limacher

Re: H5P fails on Android Moodle App or browser

by Isabel Renedo -
Picture of Moodle HQ Picture of Particularly helpful Moodlers

Hi Craig,

Please check whether a Proxy/Firewall/Web Server security module is setting the X-Frame-Options header in your HTTP request responses. If this is the case, it is recommended to deactivate this feature as it may cause conflicts, as Moodle already sets this header by default. Please visit the Moodle FAQ - H5P packages don't work on my site
 
Kind regards,
Isabel
In reply to Craig Limacher

Re: H5P fails on Android Moodle App or browser

by matthew boyd -

I literally just fixed my server :D

In your root directory (/var/www/html/moodle or wherever your root is) make a file .htaccess. 

<If Module mod_headers.c>

Header always append X-Frame-Options SAMEORIGIN 

</IfModule>

I run our moodle on our own server on a VPN but I encourage you to read about headers to be on the safe side. The last thing you want to do is make your server vulnerable. Hope this helps and was my solution for my scenario.  Your mileage may very. 

In reply to Craig Limacher

Re: H5P fails on Android Moodle App or browser

by Queenie Chan -
Curious to find if you've found a fix for this?

Allowed embedding frames is on, i've tried the .htaccess Matthew had suggested - none have fixed this issue for us yet.
In reply to Queenie Chan

Re: H5P fails on Android Moodle App or browser

by matthew boyd -

Hello,

You can also try to edit /etc/apache2/config-enabled/security.conf

add the line: 

Header always set X-Frame-Options "SAMEORIGIN"

to the bottom. 

be sure to leave the .htaccess file and restart the apache server. hopefully this will help you. 

In reply to matthew boyd

Re: H5P fails on Android Moodle App or browser

by Queenie Chan -
Hi,

Thanks, i think my issue is, our instance isn't on apache. We're on nginx.

What solved this issue for us was...
add add_header Content-Security-Policy "frame-ancestors *" always; to nginx config
In reply to Queenie Chan

Re: H5P fails on Android Moodle App or browser

by matthew boyd -

The important thing is that you solved. Now hopefully in the future anyone using apache or NginX will find the solution. 

Glad you solved it