vendredi 23 janvier 2015

Javascript : Get the HTMLAudioElement currently playing

How can I access an HTMLAudioElement that is currently playing, without knowing anything about it? It is not an <audio> tag in the page, it is a



audio_element = document.createElement('audio');


But now (at the time when I want the audio to pause) the DOM has been modified by a



$('#details').html().load(ajax_loader, "id=" + id, function() {
<!-- another playlist -->
}


And I can't seem to retrieve my audio element back. It's no longer in the DOM, but the audio is still playing witch is fine BTW, but now I want to play something else. And when I do, I can hear both audio files.


So really my question is just that : How can I access an HTMLAudioElement that is currently playing, without knowing anything about it?


Aucun commentaire:

Enregistrer un commentaire