W3C home > Mailing lists > Public > public-media-capture@w3.org > December 2011

Re: First draft available

From: Rich Tibbett <richt@opera.com>
Date: Thu, 01 Dec 2011 12:14:49 +0100
Message-ID: <4ED761A9.6040404@opera.com>
To: Robin Berjon <robin@berjon.com>
CC: Stefan Håkansson LK <stefan.lk.hakansson@ericsson.com>, public-media-capture@w3.org
Robin Berjon wrote:
> var um = navigator.getUserMedia(options);
> um.onsuccess = function (stream) { ... };
> um.onerror = function (err) { ... };
> um.start();

This doesn't work. If the web page does not register a success callback 
then we don't want to go through any user authorization process for 
accessing the camera. When the success callback is a non-optional inline 
as in the current proposal then we get that assurance.

> Or the Node-style compound callback:
> navigator.getUserMedia(options, function (err, stream) {...});

We (Opera) have done a fair amount of implementation work, tutorials, 
public speaking and developer evangelism around the existing mechanism. 
This is also published in technical books you can find on current book 
shelves [1].

I'm not really sure this change would be worth it, considering the 
following example basically does exactly the same thing:

navigator.getUserMedia(options, handle, handle);
function handle(callback) {
   if(callback.code) return someErr;
   // process as a success callback

- Rich
Received on Thursday, 1 December 2011 11:15:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:08 UTC