This small JavaScript library is an easy way to manage a queue of items you are playing. <script type="text/javascript"> var player = Phonograph.create(); var tracks = [ 'http://some.mp3', 'http://some-other.mp3' ]; player.trackChanged(function() { alert("We're now playing a new track!"); }); player.play(tracks); </script>