I am looking to develop a basic webpage with an autoplay audio feature. The page would include a "pause" and "play" button. I aim to implement a function where clicking the "pause" button would stop the audio, but after 3 seconds, it would automatically resume from where it was paused.
I am envisioning an if function that halts the audio when the "pause" button is pressed, and then after a 3-second delay, triggers the "play" button automatically. (This is a concept I have in mind, but I lack the technical expertise to execute it)
Below is the snippet of my HTML code:
<audio id="player" src="audio/song.mp3" loop></audio>
<div>
<button class="play" onclick="document.getElementById('player').play()">Play</button>
<button class="pausa" onclick="document.getElementById('player').pause()">||</button>
</div>