Reputation: 1325
I was wondering if there was any Javascript method that could help getting information on the state of an audio tag:
and the sort. I know that we can use play()
, pause()
and others but not quite sure on how to check in the script that the audio is playing in order to trigger another event/action maybe ?
Upvotes: 0
Views: 932
Reputation: 18870
Yes you can check a number of attributes on the HTML5 media elements, a list of which you can find in the W3C HTML5 Specification itself.
Under the "playback state" list you can see such attributes as paused
, muted
, ended
etc.
Upvotes: 1