Embed code does not work

Hello. I created a dialog card and the embed iframe code worked well on another site. The display embed setting was set to 'only for editors'. I have since created an accordion, a true / false and another dialog card and the embed codes have not worked for any of them. The error message reads: 'content unavailable.' I have changed the display embed setting to 'always' but still the embed codes do not work. Please advise. Many thanks. 

I should have added that I am using wordpress 4.9.6

BV52's picture

Hi Normski52,

In order to give your bug report the best chance of getting answered, please include the following information:

  1. Detailed steps to reproduce the bug (exactly how and when did it happen)
  2. Platform and version number. E.g. Drupal, Wordpress, Moodle.
  3. Mobile or Desktop
  4. Browser: Chrome, Firefox, Safari etc
  5. H5P plugin version
  6. H5P content type and version (if a content type was used), and a sample URL or attached H5P.
  7. Any browser console errors
  8. Any PHP errors
  9. Screenshots if it's a visual problem

The more information you provide, the quicker the community will be able to fix it and the quicker you'll have a working solution!

-BV52

Hello BV2, Many thanks for your response. 

1. I created a dialog card. The display embed setting is set to 'only for editors'. The error message reads: ‘content unavailable.'  

2. Wordpress 4.9.6

3. Desktop

4. Error on both Chrome and Firefox

5. H5P 1.10.2

6. Dialog card

7. Not known

8. Not known

9. N/A

Many thanks

Normski52

icc's picture

Have you tried updating the embed setting on each of the individual content?

Yes. I have tried that. Am I correct in thinking that the embed code will not work on wordpress unless <embed> is publicly viewable at the foot of the content?

icc's picture

That is correct. If you want the embed code to still work after disabling the button you're going to have to add the following setting to your wp-config.php file:

define('H5P_EMBED_URL_ALWAYS_AVAILABLE', true);

It's very kind of you to take the time to respond. 

Hi. I think I might be having the same proble. And I'm trying to apply the same solution. Just to check if I understood correctly. Setting Display Embed button to Always and adding the code to wp-config.pho will turn on Display Embed button for all h5p contents, even if it was previously disabled in either the individual content or in the H5P Settings page.

Looking forward to your reply.

and thanks for taking the time to respond.

Hi. I think I might be having the same proble. And I'm trying to apply the same solution. Just to check if I understood correctly. Setting Display Embed button to Always and adding the code to wp-config.pho will turn on Display Embed button for all h5p contents, even if it was previously disabled in either the individual content or in the H5P Settings page.

Looking forward to your reply.

Hi. I think I might be having the same proble. And I'm trying to apply the same solution. Just to check if I understood correctly. Setting Display Embed button to Always and adding the code to wp-config.pho will turn on Display Embed button for all h5p contents, even if it was previously disabled in either the individual content or in the H5P Settings page.

Looking forward to your reply.

BV52's picture

Hi LANGCOM,

I'll answer your question in 2 parts:

  1. Setting the Display embed button to "Always" will not override the previously disabled embed buttons, this will only apply to newly created contents and you cannot change the option in the editor as oppose to "Controlled by author".
  2. Adding the code provided icc also will not override the previously disabled embed buttons, the embed code does not work if you change it to not disblay the button. This code will make the embed code work even if you disable the button.

-BV

My problem is that I am using wordpress within my work environment. I am not able to add plugins or any modifications at all. I have been creating the H5P content on my personal site, and then embedding it in my work site. This worked fine until the most recent update of WordPress, which seems to have disabled the ability to embed iframe code. I add the code to my text editor, and as soon as I update the post, the code is stripped from my document.

otacke's picture

Hi sandrad!

Based on what you are describing (general problems with iframe code), wouldn't it be better to ask for help in the WordPress forums?

I am running systems with WordPress 5.3.2 and 5.3.3(beta) and can't reproduce your problem on any of them (using the classic editor in text mode).

Best, 

Oliver 

telugu's picture

Hi Otacke,

I am using Moodle 3.10.5. Using the core option in Content bank created an Interactive video as a Teacher. I want to provide embed content type option and enabled it. But when I try to embed it in a Q and A forum of other course it is not displaying.


I gave Allowed sources as https://subdomain.domain.in/content/[id]/embed

Do I need to change this? Am I doing correct? Please help me understand the issue and solve it.

otacke's picture

Hi telugu!

The moodle core integration of H5P was created by the moodle team (not by the H5P core team) and I am too busy to learn about all its peculiarities. I guess your best bet is to ask on the moodle forums.

Cheers,
Oliver