I am wondering how I make get an audio file to play 'continuously' on all pages. So if the audio file has played for 20 seconds, then when navigating on another page it will continue from where it left off. I also am trying to get the volume to decrease after navigating away from my home page. Any tips or advice would me appreciated! Thanks =D
<audio src="songforsite.mp3" loop="true" autoplay="true" controls>
Unsupported in Firefox
</audio>
Yes, it is possible. try this:
If you really navigate to another page, then you will not get really continuous playback.
There are three common approaches:
All approaches have their pros/cons. Popup is maybe the easiest to implement, and has the least drawbacks (compared to frames).
Then catch any clicks on your “home” link/button, and call the
volume
method of theaudio
element with a parameter value ranging from 0 to 1 to set the volume.well .. a clean and neat way to do it , is the way that soundcloud.com and spoify.com made through ajaxifing all the pages
fix a page and change the pages content through ajax ,and change the url as well to give the user the illusion of navigating this is not the easiest or fastest solution ,but it's the cleanest one ..far away from the fear of browsers incompatibilities