W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2008

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

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 19 Aug 2008 12:58:52 +1200
Message-ID: <11e306600808181758p14c444calcb1b65683bff3ce6@mail.gmail.com>
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.

"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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080819/29144a43/attachment.htm>
Received on Monday, 18 August 2008 17:58:52 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:04 UTC