Jump to bookmarks with external javascript or HTML

mronkko's picture

Hi,

I am using the interactive video component to include lecture videos on a Moodle site. Is it possible to control the player from external javascript or HTML? What I would like to do is to have a list of lecture slide thumbnails that the user could click to go to the bookmark corresponding to each slide.

Mikko

Content types: 
mronkko's picture

It turns out that this is possible to do with a javascript oneliner.

<a href="javascript:document.getElementsByClassName('h5p-iframe')[0].contentWindow.H5P.instances[0].seek(Object.keys(document.getElementsByClassName('h5p-iframe')[0].contentWindow.H5P.instances[0].bookmarksMap)[0]);">Bookmark1</a>

But this solution cannot be used in Moodle because it removes all javascript from teacher editable content.

Mikko

otacke's picture

Hi Mikko!

If JavaScript is stripped from your content, then I don't think there's anything you could do.

Best,
Oliver