T
T
Tenebrius2015-07-29 16:45:14
JavaScript
Tenebrius, 2015-07-29 16:45:14

How to catch the event of the end of playback of audio elements created programmatically?

A number of tags are created on the page. How to make a certain function be called if any of the elements finish playing the music?
This option doesn't work:

document.getElementsByTagName('audio').onended(a_ended());

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2015-07-29
@IonDen

Use plugin , latest demo.
And so you have an error in your code: .onended(a_ended()); you call the a_ended function right here, but you just need to pass a link there: .onended(a_ended)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question