title: Hide HTML5 video in UIWebView if it cannot be played
body: <p>I have a UIWebView that contains a HTML5 video. The <code>SRC</code> of the video is dynamic, and uses HTTP Live Streaming. If, for whatever reason, the video cannot be played, the user is presented with the "play-with-a-slash-though-it" icon, indicating it cannot be played. I'd like to handle this situation by hiding the video player and presenting a message to the user instead. Are there any callbacks that I can subscribe to that will allow me to achieve this?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Thanks to codeghost's answer, I was able to resolve my problem. However, I thought it would be useful for future readers to see a code example:</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;video id='video' width='640' height='480' controls='controls' preload='none' autoplay='autoplay'&gt;
              &lt;source src='http://some.video.com'/&gt;
              Your browser does not support the video tag.
          &lt;/video&gt;
  
          &lt;script type='text/javascript'&gt;
              var video = document.getElementById('video')
              video.addEventListener('error', function(event) { 
                  if(event.type == "error")
                  {
                      alert("There was an error getting the video.");
                  }
              }, true);
  
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>