H_MZ 2016-03-14 16:20 采纳率: 0%
浏览 4

为什么此音频循环?

I have an ajax call in my code, when a new message comes it plays an audio file but the audio file is playing over and over again even if i didn't set it to loop.

Here's the <audio> I used:

document.getElementById("notifsound").innerHTML = '<audio autoplay><source src="./uploads/notif.mp3" type="audio/mp3"><p></p></audio>';
  • 写回答

1条回答 默认 最新

  • weixin_33743880 2016-03-14 16:28
    关注

    Add loop=false as an attribute to the HTML audio tag

    评论

报告相同问题?