W3C home > Mailing lists > Public > public-device-apis@w3.org > December 2009

Re: <input type=photo> etc as Capture API

From: Robin Berjon <robin@robineko.com>
Date: Fri, 4 Dec 2009 12:26:09 +0100
Cc: ext Arve Bersvendsen <arveb@opera.com>, "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-Id: <311F1147-2EFE-495E-BEC6-F90491CDE107@robineko.com>
To: Ilkka Oksanen <Ilkka.Oksanen@nokia.com>
On Dec 3, 2009, at 12:57 , Ilkka Oksanen wrote:
> How much more complex would equivalent <input> based solution be?

There's too much hand-waving in this thread :) Let's write some code!

Here's an input based approach that (assuming the click event can be synthesised in this runtime), it's off the top of my head, may contain errors:

function getVideo (sucCB) {
    var inp = document.createElement("input");
    inp.type = "file";
    inp.accept = "video/*";
    inp.onchange = function () { sucCB(this.files[0]); };

function processVideo (file) {
    document.getElementById("my-video").src = file.URL;


(The above is just to try to ground the discussion.)

The code is simple enough, and typical enough, but my concern is whether this approach can scale to controlling the video. So in the above I've embedded the captured video in the page, but this assumes that it's already been recorded. How do I grow that into something that could stream it (streaming is hard enough already, I'm not sure how it marries to the form metaphor)? How do I grow that into something using which I could control the capture from within the document?

Robin Berjon
  robineko  hired gun, higher standards
Received on Friday, 4 December 2009 11:26:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:41 UTC