const single_player = document.querySelectorAll(".h5ap_single_button"); single_player.forEach(item => { const audio = item.querySelector("audio"); audio.volume = 0.6; item.querySelector('.play').addEventListener("click", function () { console.log('Audio'); single_player.forEach(player => { player.querySelector("audio")?.pause(); }) setTimeout(() => { audio.currentTime = 0; audio.play(); }, 0);
});
item.querySelector('.pause').style.display = 'none'; item.querySelector('.pause').addEventListener("click", function () { audio.pause(); });
audio.addEventListener("ended", () => { item.querySelector(".play").style.display = 'inline-block'; item.querySelector(".pause").style.display = 'none'; });
audio.addEventListener("pause", () => { item.querySelector(".play").style.display = 'inline-block'; item.querySelector(".pause").style.display = 'none'; }); audio.addEventListener("play", () => { item.querySelector(".play").style.display = 'none'; item.querySelector(".pause").style.display = 'inline-block'; });
})