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

Re: Camera API proposal

From: Brad Lassey <blassey@mozilla.com>
Date: Wed, 26 Aug 2009 16:30:14 -0400
Message-ID: <4A959B56.4040209@mozilla.com>
To: Robin Berjon <robin@berjon.com>
CC: marcosc@opera.com, Max Froumentin <maxfro@opera.com>, public-device-apis@w3.org, andreip@google.com
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.

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

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

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

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