HTML5 check if audio is playing?

Harry picture Harry · Feb 24, 2012 · Viewed 135.2k times · Source

What's the javascript api for checking if an html5 audio element is currently playing?

Answer

Niet the Dark Absol picture Niet the Dark Absol · Feb 25, 2012
function isPlaying(audelem) { return !audelem.paused; }

The Audio tag has a paused property. If it is not paused, then it's playing.