4 ms·
> http://ernestdelgado.com/public-tests/gifoncanvas/ http://ernestdelgado.com/public-tests/gifoncanvas/ Kinda: > if we add an animated GIF as the first source
by masklinn 14y ago
> http://ernestdelgado.com/public-tests/gifoncanvas/ http://ernestdelgado.com/public-tests/gifoncanvas/
Kinda:
> if we add an animated GIF as the first source, every time a drawImage call happens it will render whatever the status of the GIF is at that very second
So if you call drawImage in a (timeout/setinterval) loop, you can get the frame's data, compare to the previous frame's data and if they're different you got a new frame-worth of data.
Considering that requires canvas support (with image-query capabilities) you're probably better off using websockets and the like.