I’m creating a small HTML5-based website. At some point I want to play a sound. I’m playing the sound like this:
sound = new Audio(url);
sound.addEventListener("error", function(e) {
console.log("Logging playback error: " + e); });
sound.load();
sound.play();
When an error occurs, I can’t figure out what’s in e. Unfortunately the error occurs only on an iPad, so I can’t use Firebug to debug it. Nowhere in the documentation did I found the description of the argument.
Any help would be appreciated.
I probably found that error message object. The error code is in
sound.error.codeor alsoe.currentTarget.error.codeproperty and it can contain one of the following 4 digits:examined it @jsfiddle