Rewind audio and a linked animation when complete

rewind_after.hype.zip (79.2 KB)
Hello,
I have an audio file linked to an animated button. The button allows pause play and only animates when the audio is active. What I need is for the audio to rewind and the animation to stop once the audio has completed playing. I am having a time of it trying to get both to stop and rewind.

Any help is greatly appreciated! Thanks!! Tom

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)
};

This listens to when the Audio has ended using the Ended / onended event function

Have a read through this

1 Like

Thank you so much!!! and thanks for the link. Good resource.

1 Like