Re: First draft available

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