更新时间:2022-06-16 03:50:33
预先在html中预加载音频文件喜欢:
Preload your audio file in the html beforehand like :
<audio id="xyz" src="whatever_you_want.mp3" preload="auto"></audio>
if(x > 10)
{
document.getElementById('xyz').play();
alert("Thank you!");
}
这肯定有效。