Trying to embed Moodle hosted VR with iFrame

Trying to embed Moodle hosted VR with iFrame

av Otaku Dude -
Antall svar: 3

Hiya,

I'm experimenting with adding interactive VR content using an iframe. I have some HTML 5 output in a folder (basically the images, a html file and some javascript) that I have uploaded using the file resource. I use the URL of the HTML file in my iframe but I don't see the VR content. 

Has anyone had any luck doing something like this hosting the content within Moodle?

Many thanks,

Nigel.

(Moodle 3.6.2)

Gjennomsnittlig vurdering: -
Som svar til Otaku Dude

Re: Trying to embed Moodle hosted VR with iFrame

av Justin Hunt -
Bilde av Particularly helpful Moodlers Bilde av Plugin developers

Hi Nigel

The most likely cause of this is that the editor is stripping your iframe content when you save it.

After you save it, and then return to the page/activity in edit mode, is the content that you added still there? If not then the editor has stripped it. Its a security thing, because students and some teachers could post content intentionally or unintentionally that you really do not want on the site.

if thats the case you need to grant the ability to add "trusted content" to the site to user roles which you trust. See this document for how to do that:

https://docs.moodle.org/36/en/Site_security_settings#Enable_trusted_content

Som svar til Justin Hunt

Re: Trying to embed Moodle hosted VR with iFrame

av Otaku Dude -

Hiya Justin,

Thank you for your response. I have trusted content enabled in both policy and role. Moodle creates a space for the iframe and there is a scroll bar for the content at the bottom, but no content. When I visit the page with editing on or off Moodle keeps automatically downloading just the html file.

Thank you,

Nige.

Som svar til Otaku Dude

Re: Trying to embed Moodle hosted VR with iFrame

av Justin Hunt -
Bilde av Particularly helpful Moodlers Bilde av Plugin developers

OK that sounds promising. Moodle can  not control what goes on in the iframe, so if the iframe is there and the content is not, its hopefully just the URLs to the VR contents, and nothing to do with Moodle.


If you open your browser console and load the page with the iframe, any 404 (file not found) or javascript errors should be displayed there. With any luck that will lead you to the source of the problem.

(Browser console: https://developers.google.com/web/tools/chrome-devtools/console )