标签:
(function() { var audio = document.getElementById(‘myAudio1‘); audio1 = audio; audio.src = source; audio.loop = true; audio.autoplay = true; audio.play(); audio.addEventListener(‘canplay‘, canPlay, false); })();
(function() { var audio = document.createElement("AUDIO"); audio2 = audio; audio.setAttribute("src", source); audio.setAttribute("loop", ‘true‘); audio.setAttribute("controls", ‘controls‘); audio.setAttribute("autoplay", ‘true‘); audio.setAttribute("id", ‘myAudio2‘); audio.addEventListener(‘canplay‘, canPlay, false); document.getElementById(‘example2‘).appendChild(audio); audio.play(); })();
(function() { var audio = new Audio(); audio3 = audio; audio.src = source; audio.loop = true; audio.id = ‘myAudio3‘; audio.autoplay = true; audio.addEventListener(‘canplay‘, canPlay, false); audio.play(); })();
howler.js: http://goldfirestudios.com/blog/104/howler.js-Modern-Web-Audio-Javascript-Library buzz.js: http://buzz.jaysalvat.com/ audio.js: http://kolber.github.io/audiojs/ jPlayer.js: http://jplayer.org/
标签:
原文地址:http://www.cnblogs.com/xiaoheimiaoer/p/4535676.html