1
This falls in the 'other ideas' category. A good way to handle streaming is to offer a playlist file (.m3u) as a link. This is just a plain text file (with .m3u extension) that contains a list of URLs of soundtracks that you want to stream.
Basically the browser will hand off the playlist to the user's media player (or other relevant application), which will understand that it should start streaming the track. If the playlist contains multiple URLs, the user can skip back and forth between them in the player.
You can also stream video in this way. It's not ajax, but it is crazy simple and flexible, and it leaves the user's browser free.
On the programming side, you can dynamically generate a playlist file by sending a header, like:
Basically the browser will hand off the playlist to the user's media player (or other relevant application), which will understand that it should start streaming the track. If the playlist contains multiple URLs, the user can skip back and forth between them in the player.
You can also stream video in this way. It's not ajax, but it is crazy simple and flexible, and it leaves the user's browser free.
On the programming side, you can dynamically generate a playlist file by sending a header, like:
header('Content-Type: audio/x-mpegurl audio/mpeg-url application/x-winamp-playlist audio/scpls audio/x-scpls; charset=iso-8859-1');
header("Content-Disposition:inline;filename=stream_soundtrack.m3u");
echo $url;
exit();