Add onerror handling for img/video loading.

I don't think video elements support these events in the same way image elements do. https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video indicates that for Firefox, it's necessary to call vid.addEventListener('error', function(event) { ... }). Please take some time and research exactly how this should work. Also please study how WebGLTestUtils.startPlayingAndWaitForVideo works, in particular its use of the playing and timeupdate events.