Re: Camera API proposal

On 8/26/2009 11:20 AM, Robin Berjon wrote:
> On Aug 7, 2009, at 19:11 , Brad Lassey wrote:
>> On 8/7/2009 11:09 AM, Marcos Caceres wrote:
>>> On Fri, Aug 7, 2009 at 4:55 PM, Max Froumentin<maxfro@opera.com>  
>>> wrote:
>>>> As annevk says in the comments of that page, an interesting 
>>>> alternative is
>>>> to use a form item, like<input type=file accept="image/*"/>  
>>>> combined with
>>>> FileUpload to access the uploaded file's content.
>>>> http://dev.w3.org/2006/webapi/FileUpload/publish/FileUpload.html
>>>>
>>> Yes, see also:
>>> http://blog.mozilla.com/blassey/2008/09/23/camera-input-tag/
>>> http://ajaxian.com/archives/input-camera
>>>
>> If we do standardize on a Javascript API, I think it should provide 
>> some mechanism for doing a live video preview of the camera.  Perhaps 
>> by passing in the id of a video element.
>
> It would certainly be useful, and may tie in to the discussions there 
> have been around FileUpload being about to return some form of live 
> URL that can temporarily point to the data.
>
> In general this is the sort of situation in which I prefer to have 
> both an API and a markup option (which it probably isn't up to this WG 
> to standardise). Brad: since you implemented that using markup, can 
> you give us a feel for what you'd need from a JS API to do the same 
> (apart from a way of displaying the viewfinder)?
>
> It's possible to do without hooking into a video element — or an image 
> element, the way the Nokia proposal does [0] — e.g. by positioning a 
> viewfinder à la BONDI [1]. But tying into an element has the advantage 
> that the output can be reused and composited.
>
> [0] 
> http://lists.w3.org/Archives/Public/public-device-apis/2009Apr/att-0001/camera.html 
>
> [1] 
> http://bondi.omtp.org/apis-current/classorg_1_1omtp_1_1bondi_1_1camera_1_1_camera.html#f0bb16c0da468c0c1fbc759cce2ec6d0 
>
>
I think the best way to provide support for a live video preview is to 
feed the video through an html5 video tag.  The simplest way to do that, 
IMHO, would be to have a method in the api  that returns a URI that can 
be used as the source for a video tag.

ex:
    myVideoEl.src = cameraAPI.getVideoPreviewURI().spec;

Of course we could just return a string with the spec as well.

-Brad

Received on Wednesday, 26 August 2009 20:31:22 UTC