YouTip LogoYouTip

Av Event Abort

## HTML Audio/Video DOM: `abort` Event The `abort` event fires when the loading of an audio or video file is aborted (prevented from completing). Crucially, this event is triggered when the media download is intentionally or systematically terminated, rather than when a playback or network error occurs. --- ## Definition and Usage The `abort` event is dispatched when the browser stops fetching media data before it is completely loaded. This typically happens due to user action (such as stopping the page load or navigating away) or programmatic intervention (such as changing the media source mid-stream). ### Related Media Loading Events To fully monitor the lifecycle of media loading, you should also be familiar with these related events: * **`emptied`**: Fires when the media resource list becomes empty (e.g., if the media is reloaded). * **`error`**: Fires when an error occurs during the loading of media data. * **`stalled`**: Fires when the browser is trying to get media data, but data is not forthcoming. * **`suspend`**: Fires when the browser intentionally stops fetching media data (e.g., when the media is fully buffered). --- ## Syntax You can register the `abort` event listener in three ways: ### 1. In HTML ```html
← Av Event EndedEvent Onwheel β†’