如何播放 HTML
首先使用以下 HTML 逐个播放 HTML <audio> 片段 −
<audio id = "one"> <source src = "new1.mp3" type = "audio/mp3"> </audio > <audio id = "two"> <source src = "new2.mp3" type = "audio/mp3"> </audio >
你需要执行以下操作逐个播放音频 −
var one = document.getElementById('one'); one.onended = function() { document.getElementById('two').play(); } one.play();
广告