So I am playing audio file in Chrome and I want to detect when playing has ended so I can delete references to it. Here is my code
var source = context.createBufferSource();
source.buffer = sound.buffer;
source.loop = sound.loop;
source.onended = function() {
delete playingSounds[soundName];
}
source.connect(mainNode);
source.start(0, sound.start, sound.length);
however, the event handler doesn't fire. Is this not yet supported as described by the W3 specification? Or am I doing something wrong?
Chromium only added this recently (end of May, I think). Pretty sure it's not in the stable releases yet.
Have you tried it in Chrome Canary?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With