An abstract superclass for media classes that display audio or video in webpages. This class defines common properties and methods inherited by the HTMLAudio and HTMLVideo classes representing the HTML audio and video elements.
SDKs
- Safari Desktop 10.0+
- Safari Mobile 3.0+
Framework
- WebKit JS
Overview
Handling Events
The different types of media events that can occur are described in Table 1.
Media element events
Event | Description |
|---|---|
| Sent when the browser stops fetching the media data before the media resource was completely downloaded. |
| Sent when the browser can resume playback of the media data, but estimates that if playback is started now, the media resource could not be rendered at the current playback rate up to its end without having to stop for further buffering of content. |
| Sent when the browser estimates that if playback is started now, the media resource could be rendered at the current playback rate all the way to its end without having to stop for further buffering. |
| Sent when the |
| Sent when the media element network state changes to the |
| Sent when playback has stopped at the end of the media resource and the |
| Sent when an error occurs while fetching the media data. Use the |
| Sent when the browser can render the media data at the current playback position for the first time. |
| Sent when the browser knows the duration and dimensions of the media resource. |
| Sent when the browser begins loading the media data. |
| Sent when playback pauses after the |
| Sent when playback starts after the |
| Sent when playback starts. |
| Sent when the browser is fetching the media data. |
| Sent when either the |
| Sent when the |
| Sent when the |
| Sent when the browser is fetching media data but it has stopped arriving. |
| Sent when the browser suspends loading the media data and does not have the entire media resource downloaded. |
| Sent when the |
| Sent when either the |
| Sent when the browser stops playback because it is waiting for the next frame. |