This is a bug in Firefox. The easiest fix is to simply keep trying until the error goes away, since no event fires at the correct time.
See: http://jsfiddle.net/9aT63/25/
Basically, you have to wrap the drawImage
call in a try/catch block.
function drawVideo() {
try {
$vidCanvasCtx.drawImage($vid, 0, 0, $vidCanvas.width, $vidCanvas.height);
...
} catch (e) {
if (e.name == "NS_ERROR_NOT_AVAILABLE") {
// Wait a bit before trying again; you may wish to change the
// length of this delay.
setTimeout(drawVideo, 100);
} else {
throw e;
}
}
}