I have a project I’m doing in Hype 3, pretty simple slideshow with audio and images animated. I originally wanted each slide to be triggered by On Scene Load but I see that audio in Chrome does not work. This is problematic for me as I now have to trigger the audio from a button.
But now I cannot get Jump To Scene to work for example I now have the following:
Scene 1
TimelineActions / pause timeline
Action1- Button / on mouse click triggers PlaySound
Action 2- Start Timeline
At 8 seconds ( when audio ends)
TimelineActions / jump To Scene/ Scene 2
Ok just going over this as I just made a demo which will work in all browsers except Chrome. It has no audio controls and goes scene to scene using OnSceneLoad and audio loads fine
A bit mixed up about the code you sent, should I delete the OnSceneLoad code and replace with the code you sent?
If so I need to have the audio play when the scene loads and a timeline function to take the viewer to the next scene follow?
Change your audio_init_2() function to this. window.my_audio_2 = hypeDocument.getElementById(“my_audio_narration_2”); //hypeDocument.getElementById(“my_audio_narration_2”).loop = true; hypeDocument.getElementById(“my_audio_narration_2”).volume= .5; window.my_audio_2.onended = function() { hypeDocument.functions().show_hide_narration_2(hypeDocument, element, event) };
?? change getElementById to the name of my audio?
thats it?
It's hard to really tell you what to do since I don't know what you're doing -- once you have a demo you are able to share I'd be happy to see what I can help with. The key thing you need to do is setup a thing to detect whether the audio is ended. That project does, but you'll need to adapt it to your needs. The key part is:
window.my_audio_2.onended = function() {
// do something
}
So you would use some part of that -- and keep in mind that this also requires that your audio object is created outside of Hype's audio system. This is the code you need to get going: HTML Audio/Video DOM ended Property, a nice snippet of code here: W3Schools Tryit Editor