I've got a folder containing several *.mp3 files. Now what I'm trying to achieve is, that these mp3s are played on my webpage continously meaning that if I close my browser and open the page i.e. 10 seconds later again, the song should continue 10 seconds after I left.
It also should play the same file for every client connected. (So pretty much like a web-radio)
But how could one do that most efficient? I made a little sample project, which is increasing a value on a database every second, and if the value is larger than the playtime of the mp3, it will change the active mp3.
Same goes for the client, every second I check if the mp3 has changed and if so i change the src of the audio tag.
But I beleive this is not really efficient. Does anyone have any ideas on how to decrease the ressources used?
Thanks in advance.