The place for more technical questions for those who want to create new pagetypes or bespoke functionality.

Creating a hotspot to play sound and then move to another page

  • Onderwerp Auteur
  • Nieuw lid
  • Nieuw lid
Meer
2 jaren 3 maanden geleden #9010 door
I would like to have a hotspot make a sound and then, when the sound finishes, move on to another page (specifically make the sound of a key turning and door opening - yes, for an escape room!). I can do one or the other but not both. Is there a way to do this? Thanks for any help. (I've put this message in "Creating effective materials" too as I wasn't sure where it fits!)

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
2 jaren 3 maanden geleden #9011 door ronm
Hi what page type are you using is it hotspot connector?
Is it something like this that you want to create? training.mitchellmedia.co.uk/xot/play.php?template_id=449#page1
As you can see you can achieve that but only with custom code and it's not straightforward because you have to inspect and find the correct IDs and also obtain the pageID's to link to. I don't think there's an easy way to do this just from the built-in options.
The code I've used in that example added to a script optional property attached to the hotspot connector page is as follows:
$('#mep_0 audio').on('ended', function() {
x_navigateToPage(false,{type:'linkID',ID:'PG1713780621292'});
});
$('#mep_1 audio').on('ended', function() {
x_navigateToPage(false,{type:'linkID',ID:'PG1713784570265'});
});
$('#mep_2 audio').on('ended', function() {
x_navigateToPage(false,{type:'linkID',ID:'PG1713789918321'});
});
So each hotspot has the same audio file attached but each one automatically gets an ID as you add them starting from 0 e.g. #mep_0, #mep_1, #mep_2
then the code triggers when the relevant audio has ended and then navigates to the pageID set in the code.
You can get the pageIDs by adding internal page links to a text area on a hidden page and then viewing the source and copying the ID's and amending the code accordingly. e.g. so in this example I would end up with 7 hotspots and destination pageIDs.
HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/
De volgende gebruiker (s) zei dank u: xlearn,

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • Onderwerp Auteur
  • Nieuw lid
  • Nieuw lid
Meer
2 jaren 3 maanden geleden #9014 door
That's exactly what I want to do (but was only going to have one door) - I'll give this a try. Thank you!

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: JohnSmith
Tijd voor maken pagina: 0.126 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo