HTML Media Event Handler Attributess
HTML Media event handlers are those that triggered by changes of video, audio or images.
For example, the following event handler "onabort" will show an alert window when the Media is paused.
<audio src="file/Ring.mp3" onpause="alert('audio stopped by user!');" controls> </audio>
List of media event handler attributes:
Attribute Names | Events |
onabort | When terminated |
oncanplay | When buffered |
oncanplaythrough | When buffering is not required |
ondurationchange | Change of playback duration |
onended | When play is over |
onerror | Error encountered |
onloadeddata | When media is loaded |
onloadedmetadata | When duration and dimensions of the media is loaded |
onloadstart | |
onpause | |
onplay | When play begins |
onplaying | |
onprogress | |
onratechange | When playback rate changed |
onreadystatechange | |
onseeked | Seeking ended or not seeking |
onseeking | Seeking starts |
onstalled | Reading data stalled |
onsuspend | Reading data is being suspended |
ontimeupdate | Playing position changed |
onvolumechange | When volume changed |
onwaiting | When suspended temorarily |