HTML and CSS Reference
In-Depth Information
Important Audio Events
ManyeventsaredefinedfortheHTML5
audio
element.Wearegoingtofocusonthefollow-
ing events because they have proven to work when building audio applications:
progress
Raised when the browser is retrieving data while loading the file. (This still has spotty
support in browsers, so be careful with it.)
canplaythrough
Raised when the browser calculates that the media element could be played from begin-
ning to end if started immediately.
playing
Set to
true
when the audio is being played.
volumechange
Set when either the
volume
property or the
muted
property changes.
ended
Set when playback reaches the
duration
of the audio file and the file stops being played.