Audio/Video DOM 错误事件在 Chrome/Firefox 中不起作用

Audio/Video DOM error Event doesn't work in Chrome/Firefox

我正在尝试使用 onerror 检测音频标签中提供的 none 来源何时为 available/online。由于某些奇怪的原因,它在 Chrome 和 Firefox 中不起作用,但在 Safari、Edge 和 IE 中运行良好。这是什么原因,我该如何解决?

var audio = document.getElementById('audio');

audio.load();

// Can play
audio.oncanplay = function() {
  audio.play();
  console.log('Playing...');
};

// Cannot play
audio.onerror = function() {
  // error shows in Safari/IE/Edge but not in Chrome/Firefox
  console.log('Error! sources are not available');
};
<audio id="audio" controls>
  <source src="https://www.w3schools.com/html/horseX.ogg" type="audio/ogg">
  <source src="https://www.w3schools.com/html/horseX.mp3" type="audio/mpeg">
</audio>
<!-- Remove X from url for working mp3 samples -->

'error' 事件应附加在 Google Chrome 和 Firefox 中的源元素上。要处理多个源上的错误事件,您必须将错误句柄绑定到最后一个源。