HTML5 check if audio is playing

Use the following to check if audio is playing −

functionisPlaying(audelem) {

The above code can be used to check ifaudio is playing or not. The audio tag has a paused property.The paused property returns whether the audio/video is paused.

You can also toggle −

functiontogglePause() {
   if(newAudio.paused && newAudio.currentTime > 0 && !newAudio.ended) {;
   } else {