cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

How do I add dynamic H5P embeds based on browser size?

I'm attempting to embed some H5P Image Hotspots and I want the tool to be dynamic for various browser sizes.

I'm adding this https://h5p.org/node/477019 specific tool for example.

Here's the embed link from H5P: <iframe src="https://h5p.org/h5p/embed/477019" width="1090" height="638" frameborder="0" allowfullscreen="allowfullscreen"></iframe><script src="https://h5p.org/sites/all/modules/h5p/library/js/h5p-resizer.js" charset="UTF-8"></script>

There's also an advanced option that says... 

Include this script on your website if you want dynamic sizing of the embedded content:

<script src="https://h5p.org/sites/all/modules/h5p/library/js/h5p-resizer.js" charset="UTF-8"></script>

When I attempt to add this to the HTML5 editor, nothing happens.  The HTML5 tool doesn't accept the input.  Is there a way to do this?

0 Kudos
2 Replies
Adventurer III

Hello Jon,

Most embedded scripting is blocked by the editor, to prevent cross-site scripting security issues.  There are some suggestions for workarounds in the discussion at 

https://community.canvaslms.com/message/127321-re-how-do-i-add-javascript-in-the-html-editor 

Mike

Community Coach
Community Coach

Hello there, jsn5066@psu.edu...

I am reviewing older questions here in the Canvas Community, and I stumbled upon your question.  I wanted to check in with you because I noticed that we have not heard back from you since you first posted your question on April 5, 2019.  I see that mzimmerman@unomaha.edu replied to you a few days later.  Have you had an opportunity to review Michael's response?  If so, do you feel that it has helped to answer your question?  Or, are you still looking for some help from members of the Community with your question?  If you feel that Michael's feedback has helped to answer your question, please feel free to click on the "Mark Correct" button next to his response.  However, if you're still looking for some help, please post a note below letting Community members know how we might be able to help you out.  For the time being, I am going to mark your question as "Assumed Answered" because we've not heard back from you in over seven months and because there hasn't been any new activity in this topic for about that same amount of time.  However, that won't prevent you or others from posting additional questions and/or comments below that are related to this topic.  I hope that's okay with you, Jon.  Looking forward to hearing back from you soon.