I want to use background audio for all pages of the website but it shouldn't be started from the beginning if I refresh the page or redirect to another page. currently, I'm using this code
window.onload = function() {
var audio = new Audio('/wp-content/uploads/2022/05/shai-baba-chant.mp3');
audio.play();
}
It's working fine but there is the issue that if I refresh the page or go to another page it starts from the beginning. Is there any way to push and resume the audio after page load again?