我是 Html5 和 javascript 的新手,我想在打开 html 页面时播放音频剪辑,它应该在 10 秒后停止并显示音频播放成功的消息。
在 html5 中进行简单的音频播放,如下所示
<!DOCTYPE html>
<html>
<body>
<audio controls>
<source src="kill_bill.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<script>
setInterval(function(), 10000);
$.each($('audio'), function () { this.stop(); alert('Audio Stop Successfully'); });
</script>
</body>
</html>