Course Presentation - Switching slides from within an embedded iframe

pheraph's picture
Forums: 

Hey,

I am currently evaluating if a Course Presentation could be used for a simple point and click adventure (with Active Surface enabled). To give me more flexibility I successfully added an iframe to a slide and loaded a small minigame. Now I am struggling to switch to a different slide from within the iframe's minigame to continue the game. I tried to call jumpToSlide(), but it isn't working because of lots of undefined values:

parent.window.H5P.CoursePresentation.prototype.jumpToSlide();

Any idea how I can uses jumpToSlide() to switch to a given slide?

Raphael

Content types: 
fnoks's picture

You would need to get a reference to the CoursePresentation, you can´t invoke a function on the prototype object. The instance is available through the H5P.instances variable. I.e, you could do something like:

H5P.instances[0].jumpToSlide(2);

This code has to be loaded/run inside the H5P iframe.