@me@soc.jae.fi modern browsers require interactivity for an <audio> element to play, so I make an invisible audio element and do this:
window.addEventListener("DOMContentLoaded", event => {
const audio = document.querySelector("audio");
audio.volume = 1.0;
document.getElementById("main").addEventListener("click", () => {
audio.setAttribute("src", "music.mp3");
audio.paused ? audio.play() : audio.pause();
});
audio.play();
});
Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
ThatOneCalculator :calcdumpy: :calckey: (thatonecalculator@stop.voring.me)'s status on Thursday, 03-Nov-2022 03:37:51 JSTThatOneCalculator :calcdumpy: :calckey: