But I let the song loop from a list.
Source Code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<audio id="audiotag1" controls autoplay preload="auto" > | |
<source src="http://tegos.kz/new/mp3_full/Justin_Timberlake_-_Not_A_Bad_Thing.mp3"></source> | |
</audio> | |
<script type = "text/javascript"> | |
var idx_audio = 0 | |
//http://musicpleer.cc/ | |
var audio_list = [ | |
"http://grouprbt.tom.com/files/background/20060401152833280.mp3", | |
"http://a.tumblr.com/tumblr_kzqo9kotQ41qaejpto1.mp3", | |
"http://a.tumblr.com/tumblr_l6p1x3RFEA1qzdd22o1.mp3", //mongol | |
"http://tegos.kz/new/mp3_full/Justin_Timberlake_-_Not_A_Bad_Thing.mp3", | |
]; | |
var audio = document.getElementById("audiotag1") | |
audio.addEventListener('ended',function(){ | |
audio.src = audio_list[(idx_audio++) % audio_list.length ]; | |
audio.pause(); | |
audio.load(); | |
audio.play(); | |
}); | |
//http://stackoverflow.com/questions/21171332/play-a-list-of-audio-files-in-html | |
</script> |
0 意見:
張貼留言