Audio Play
In HTML5, audio (and video as well) can easily be played even with the player using audio/video elements.
If you add multiple audio/video elements to HTML, they'll start playing at once. And to play them one after the other, the next clip should be started after the end of the previous using ended event.
This JavaScript example shows how to play an array of audio clips one after the other:
function playAll(playList, current) {
current = current || 0;
playList[current].volume = 0.75;
playList[current].play();
if (playList[1 + current]) {
playList[current].addEventListener('ended', function () {
playAll(playList, 1 + current)
});
}
}
var playList = [
new Audio('1.mp3'),
new Audio('2.mp3'),
new Audio('3.mp3'),
new Audio('4.mp3'),
new Audio('5.mp3')
];
playAll(playList);