When I draw a gif image into a canvas element before it finishes loading the entire gif, it is just a white area. But if I do
window.stop()
Before it ends, it draws a gif in the element. The problem is that stopping the entire page stops all the gifs, not just the specific one that I want to copy onto the canvas. How can I draw what is currently loaded in the gif into the canvas element before it finishes loading the entire gif. I thought about putting it in an iframe and stopping the iframe or some other trick, but I will also like some ideas or solutions that you guys have to offer.
edit: Is there a way to determine how many of the gifs were loaded as a percentage using javascript? So that I can know that at least the first frame is loaded?
source share