<script>
jQuery(document).ready(function(){
let audioButton1 = document.querySelector(‘.play-button-1’);
let audio1 = document.getElementById(“audio-1”);
//Icon Click
audioButton1.addEventListener(‘click’, function(){
let wave1 = lottie.getRegisteredAnimations()[0];
if (audio1.paused) {
audio1.play();
wave1.play();
}else{
audio1.pause();
wave1.pause();
// audio.currentTime = 0
}
});
//Audio Finished
audio1.addEventListener(“ended”, function(){
audio1.currentTime = 0;
let wave1 = lottie.getRegisteredAnimations()[0];
wave1.pause();
});
});
</script>
<audio id=”audio-1″ src=”/wp-content/uploads/2024/01/sample-3s.mp3″></audio>