Answer the question
In order to leave comments, you need to log in
html5 audio - js , "load" event does not occur
The problem with the Audio element is that I dynamically create it in js, but the load event does not occur:
var snd = new Audio("sound.wav");
snd.preload = "auto";
snd.addEventListener("load", function() {
console.log('loaded');
},false);
snd.load();
Answer the question
In order to leave comments, you need to log in
No, there is no such possibility in the standard.
The fact is that some browsers do not download the file completely until it is needed, so it is not clear when to call event. However, you can use snd.play() at any time, regardless of the progress of the download.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question