I'm using html5 canvas to draw over a motion jpeg stream received from a camera. The code that updates the canvas is similar to this:
function update_mjpeg()
{
var img = document.getElementById("mjpeg-img"); //hidden image
overlay.temp.dcanvas.getContext("2d").(0, 0, overlay.element.dcanvas.width, overlay.element.dcanvas.height);
overlay.temp.dcanvas.getContext("2d").drawImage(img, 0, 0, overlay.element.dcanvas.width, overlay.element.dcanvas.height);
}
function animateCanvas()
{
update_mjpeg();
window.requestAnimationFrame(function() {
animateCanvas();
});
}
On chrome browser the mjpeg stream is displayed correctly and I can draw over the stream. On firefox the canvas shows only the first frame. I think this might be related to bug 667206. Is there any workaround I can use to make it work on firefox?