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

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]); };
    inp.click();
}

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

getVideo(processVideo);
"""

(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
  http://robineko.com/

Received on Friday, 4 December 2009 11:26:45 UTC