<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Audio Player</title>
</head>

<body>

<audio controls id="audioplayer">
Your browser does not support the audio element.
</audio>
<script>
	audiourl="http://m3.geoint.mx/catalog/streaming/{{publisher}}/"
	playlist={{filelist|safe}};
	player = document.getElementById("audioplayer");

	player.src = audiourl+playlist[0]+"/";
	player.load();

	i=0;
	player.addEventListener('ended',function(){
		i++;
	        player.src = audiourl+playlist[i]+"/";
        	//player.pause();
	        player.load();
	        player.play();
		});

</script>

</body>

</html>
