`

js 页面简易音乐播放器

阅读更多

<!doctype html>

<head>
  <meta charset="utf-8" />
  <title>HTML5 Document</title>
  <script>
function playClicked(element)
{
//get the state of the player
if(audio_player.paused)
{
audio_player.play();
newdisplay = "| |";
}else{
audio_player.pause();
newdisplay = ">";
}
element.value=newdisplay;
}
</script>
</head>
<body>
<audio controls="controls" id="audio_player">
 <source src="alert.wav" >
</audio>
<input type="button" onclick="playClicked(this)" value=">">
</body>
</html>

 

 

chrome 能用!!!亲测!

 

还有一个,也是能用的,取自w3协议社区

<embed type="audio/mpeg" src="Kalimba.mp3" style="width:400px; height:100px; border:3px solid black;" />

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics