Problem embedding H5P content from Wordpress into another website
Submitted by giofonseca on Tue, 01/07/2020 - 13:12
Hi there,
I would be really happy if someone can help me to figure out why I am not able to embed the following Iframe code in other websites. I created that H5P content using the WordPress plugin.
<iframe src="https://giovanni-fonseca.com/wp-admin/admin-ajax.php?action=h5p_embed&id=1" width="958" height="600" frameborder="0" allowfullscreen="allowfullscreen"></iframe><script src="https://giovanni-fonseca.com/wp-content/plugins/h5p/h5p-php-library/js/h..." charset="UTF-8"></script>
Thanks in advance for your help!
Best regards,
Giovanni
otacke
Tue, 01/07/2020 - 18:37
Permalink
Hi giofonseca!Your question
Hi giofonseca!
Your question is answered in your browser's developer console (usually opened by pressing F12) ;-)
Cheers,
Oliver
giofonseca
Wed, 01/08/2020 - 10:30
Permalink
Thanks for the hint!
Is always nice to learn something new!
What I have researched about X-frame-options at the moment disturbs me a bit, because it seems there is not a way to embed the content from my WordPress into another website, which is exactly what I am looking for in order to not use h5p.org as a hosting service. Specifically I am interested to embed H5P content into Genially presentations.
Is there another option that I have not found to make that work or Drupal or Moodle let make that job?
Any help will be very appreciated!
Best regards,
Giovanni
otacke
Wed, 01/08/2020 - 11:59
Permalink
Hi giofonseca!You need to
Hi giofonseca!
You need to change the X-frame header/Content-Security-Policy header on your server, cmp. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options (although allow-from uri is obsolete) and https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors. If you can't access the server config directly, setting the parameters in a .htaccess file inside the top WordPress folder should work as well.
Cheers,
Oliver
giofonseca
Thu, 01/09/2020 - 11:08
Permalink
Thank you very much!
Hi Oliver!
Thank you very much for your advice, that fixed the problem and now I won't depend on h5p.org anymore to host my H5P content.
Thanks again for the great work you are doing!
Best regards,
Giovanni
otacke
Thu, 01/09/2020 - 12:53
Permalink
Hi giofonseca!Thanks for
Hi giofonseca!
Thanks for letting me know. And kudos for figuring out the details yourself!
Best,
Oliver
shaqfyfe
Fri, 08/26/2022 - 07:58
Permalink
Similar Issue
Hey, can you show me how'd you fix the issue? I want to be able to embed from my wordpress too.