[whatwg] Using <video> as a source for canvas.drawImage

Robert O'Callahan robert at ocallahan.org
Mon Aug 18 17:58:52 PDT 2008


On Tue, Aug 19, 2008 at 11:24 AM, Oliver Hunt <oliver at apple.com> wrote:

> Cool -- I wonder though if it would be better if it were placed in a
> different method, drawFrame or something (very much an up in the air sort of
> question)
>

drawImage is already overloaded, so why not carry on with that, unless we
change the API as you suggest below.

One other thing that I would consider would be requiring the frame# to be
> specified explicitly as that would make things like "chapter" previews (or
> whatever) work in a way that is perhaps cleaner.  Otherwise you have to
> record the current location in the video stream, then scan to each location
> you want to blit, draw, and then return to the original position.  Which
> could easily result in weird visual behaviour for the user (as the video
> element flickers a few random frames while you do your previews or
> whatever).
>

AFAIK we'd basically have to implement that by creating a second video
stream, seeking it and then capturing the frame, and you really don't want
to do that synchronously! Then we'd want to cache that stream so that
another drawFrame with a nearby frame index was efficient ... ick. So I
suggest not offering that API. Authors can always use a second, hidden video
element to achieve the same effect.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080819/29144a43/attachment.htm>


More information about the whatwg mailing list