<audio id="audio" preload="auto" tabindex="0" autoplay controls type="audio/mpeg">
<source type="audio/mp3" src="nhac/Anh_Cho_Em_Mua_Xuan.mp3">
Sorry, your browser does not support HTML5 audio.
</audio>
<ul id="playlist" style="display: none;">
<li class="active"><a href="nhac/Anh_Cho_Em_Mua_Xuan.mp3">Bai Hat 1</a></li>
<li><a href="nhac/Ai_Ve_Song_Tuong1.mp3">Bai Hat 2</a></li>
<li><a href="nhac/Bai_luan_vu_mua_mua.mp3">Bai Hat 3</a></li>
<li><a href="nhac/Ben_cu.mp3">Bai Hat 4</a></li>
<li><a href=""></a></li>
</ul>
<script type='text/javascript'>
var audio;
var playlist;
var tracks;
var current;
init();
function init(){
current = 0;
audio = $('audio');
playlist = $('#playlist');
tracks = playlist.find('li a');
len = tracks.length - 1;
audio[0].volume = .50;
playlist.find('a').click(function(e){
e.preventDefault();
link = $(this);
current = link.parent().index();
run(link, audio[0]);
});
audio[0].addEventListener('ended',function(e){
current++;
if(current == len){
current = 0;
link = playlist.find('a')[0];
}else{
link = playlist.find('a')[current];
}
run($(link),audio[0]);
});
}
function run(link, player){
player.src = link.attr('href');
par = link.parent();
par.addClass('active').siblings().removeClass('active');
audio[0].load();
audio[0].play();
}
</script>
<source type="audio/mp3" src="nhac/Anh_Cho_Em_Mua_Xuan.mp3">
Sorry, your browser does not support HTML5 audio.
</audio>
<ul id="playlist" style="display: none;">
<li class="active"><a href="nhac/Anh_Cho_Em_Mua_Xuan.mp3">Bai Hat 1</a></li>
<li><a href="nhac/Ai_Ve_Song_Tuong1.mp3">Bai Hat 2</a></li>
<li><a href="nhac/Bai_luan_vu_mua_mua.mp3">Bai Hat 3</a></li>
<li><a href="nhac/Ben_cu.mp3">Bai Hat 4</a></li>
<li><a href=""></a></li>
</ul>
<script type='text/javascript'>
var audio;
var playlist;
var tracks;
var current;
init();
function init(){
current = 0;
audio = $('audio');
playlist = $('#playlist');
tracks = playlist.find('li a');
len = tracks.length - 1;
audio[0].volume = .50;
playlist.find('a').click(function(e){
e.preventDefault();
link = $(this);
current = link.parent().index();
run(link, audio[0]);
});
audio[0].addEventListener('ended',function(e){
current++;
if(current == len){
current = 0;
link = playlist.find('a')[0];
}else{
link = playlist.find('a')[current];
}
run($(link),audio[0]);
});
}
function run(link, player){
player.src = link.attr('href');
par = link.parent();
par.addClass('active').siblings().removeClass('active');
audio[0].load();
audio[0].play();
}
</script>