According to the HTML5 spec, drawImage() should accept an HTMLVideoElement.
The current set of methods looks like:
void drawImage(HTMLImageElement*, float x, float y);
void drawImage(HTMLImageElement*, float x, float y, float width, float height, ExceptionCode&);
void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
void drawImage(HTMLCanvasElement*, float x, float y);
void drawImage(HTMLCanvasElement*, float x, float y, float width, float height, ExceptionCode&);
void drawImage(HTMLCanvasElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&);
I started looking into this. Doesn't seem too hard (...famous last words...). The biggest problem is being able to paint part of the current video frame, which the media players don't yet support.
I'm thinking of either adding a GetCurrentFrame method to the media player, or an additional paint function that can take a clipping parameter.
I already have an implementation on mac, we're just working out design and windows issues
Has there been any update on this issue? We've itching to play around with videos on canvases :)
I'll be looking at this again once i've finished my current work with JSON
Created attachment 31769 [details]
Got eric to do the windows side of this for me. See how windows slows progress? :D
Comment on attachment 31769 [details]
Committing to http://svn.webkit.org/repository/webkit/trunk ...