【发布时间】:2019-08-17 21:04:33
【问题描述】:
我正在尝试在 chrome 上添加音频加载通知。 下面是我的 Js 代码。 它在 Firefox 上运行良好,但有时在 chrome 上它没有运行 m
错误
未捕获(承诺)DOMException
audio_notice = new Audio('http://www.sousound.com/music/healing/healing_01.mp3');
audio_notice.autoplay = true;
audio_notice.addEventListener('ended', function () {
try {
this.currentTime = 0;
this.play();
} catch (e) {
}
}, false);
audio_notice.addEventListener('load', function () {
try {
this.play();
} catch (e) {
}
}, true);
【问题讨论】:
标签: javascript audio html5-audio