title: HTML 5 audio, detect "play" with no errors
body: <p>The HTML 5 audio API is super easy, <a href="http://www.w3schools.com/tags/ref_av_dom.asp" rel="nofollow">this page</a> tells it all. But I am failing to achieve the following: catch the error (if there was one) and do something else when there are NO errors! </p>
  
  <p>You may think this is easy, and that I should attach event listeners to the "error" and "play" events. But know the following:</p>
  
  <ul>
  <li>The "error" event works only on the sub element "source", not the "audio" tag itself, this of course makes sense, since there could be more than one source.</li>
  <li>The "play" event triggers when the file starts playing for the first time and also when the file is paused and played again!</li>
  <li>The "play" event is triggered regardless of any errors!</li>
  </ul>
  
  <p>What I am trying to do is simply set both the "error" / "play" events, but prevent the "play" whenever an error occurs.</p>
  
  <pre><code>var player = $('audio#player');
  
  player.find('source').on('error', function(){
      alert('Cannot play this file!');
  });
  
  player.on('play', function(){
      setTheNextSongToPlay(' .... ');
  });
  </code></pre>
  
  <p>Now, the "setTheNextSongToPlay" function is called whether there were any errors or not. How is that possible anyway ?! THE FILES WASN'T PLAYED!</p>