Open andybarron opened 7 years ago
Can you give sample code? I've just tested with both on
and once
and both worked for me.
The audio element's error event may be binded before on('loaderror') api is called when autoplay option is true.
let audio = new Howl({
html5: true,
src: 'audio/not_exist.mp3', // the audio file not exists, should trigger error event
autoplay: true
});
audio.on('load', function () {
console.log('==>loaded');
});
/**
* Other events here.
* The delay time is uncertain.
*/
// may run after error event binded
audio.on('loaderror', function (msg) {
console.log('==>loaderror ' + msg);
});
set the delay time to test
let audio = new Howl({
html5: true,
src: 'audio/not_exist.mp3', // the audio file not exists, should trigger error event
autoplay: true
});
// just test the delay time
setTimeout(function () {
console.log('loaderror event listened');
audio.on('loaderror', function (msg) {
console.log('==>loaderror ' + msg);
});
// 10ms is good to catch the error message in my browser but 1000ms is bad
}, 1000);
Yes, confirmed that when running howl.play(); howl.on('loaderror', fn)
, the "loaderror" event is never fired, even if the src
value points to a file that does not exist and autoplay
is set to false
.
Any news about this bug?
Closing due to inactivity. If this is still an issue, reply with more info and I'll reopen.
Inactivity, yes, because the report was ignored all this time.
Inactivity, yes, because the report was ignored all this time.
I've put thousands of hours of work into this open source project. Sorry that my free labor is not sufficient enough for you.
Don't take me wrong. I just meant that this issue does exist and the reports above confirm it. Closing it due to inactivity from the maintainer does not look much legit to me.
I'm always happy to accept pull requests. The code is open source after all.
Setting the
onloaderror
config property works, but callingon
oronce
for'loaderror'
doesn't for some reason.