HTMLMediaElement: abort event

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译
您也可以阅读此文章的English (US)版。

The abort event is fired when the resource was not fully loaded, but not as the result of an error.

Bubbles No
Cancelable No
Interface Event
Event handler property onabort


const video = document.querySelector('video');
const videoSrc = 'https://path/to/video.webm';

video.addEventListener('abort', () => {
  console.log(`Abort loading: ${videoSrc}`);

const source = document.createElement('source');
source.setAttribute('src', videoSrc);
source.setAttribute('type', 'video/webm');



Specification Status
HTML Living Standard Living Standard
HTML5 Recommendation

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
abort eventChrome Full support YesEdge ? Firefox Full support YesIE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android ?


Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also


此页面的贡献者: mfuji09, mdnwebdocs-bot, wbamberg
最后编辑者: mfuji09,