Re: VideoStreamTrack: takePhoto()

On 04/07/2013 12:47 PM, Anne van Kesteren wrote:
> On Wed, Apr 3, 2013 at 7:16 PM, Travis Leithead
> <travis.leithead@microsoft.com> wrote:
>> Anne, can you whip up a proposal on how the Media Capture APIs might look with Futures, as well as provide some sample code for us to digest?
> IDL:
>
> Future takePhoto();
> Future getUserMedia(optional MediaStreamConstraints constraints);
>
> (The events for takePhoto() would go away, convention is for
> dictionaries to not be marked nullable so no "?" there. Bit unclear
> why you used two different patterns for takePhoto() and getUserMedia()
> for the same kind of task.)
>
> Example:
>
> obj.takePhoto().done(function(blob) { ... }, function(error) { ... })
> obj.getUserMedia(...).done(function(stream) { ... }, function(error) { ... })
>
> http://dom.spec.whatwg.org/#futures now has an introduction on how
> futures can be composed to do more interesting things. E.g. to take a
> photo and request some data meanwhile about the user from his
> Example.org account and then only do something if both those
> operations succeeded you could do:
>
> Future.every(obj.takePhoto(), fetch("https://www.example.org/user")).done(...)
>
>
> Futures are new, but Indexed DB uses something pretty close to them
> (and will be retrofitted going forward), CSS font loading will use
> them, lots of device APIs will start using them, and basically every
> new API that follows the pattern of having either a result or
> rejection should use them.

Anne, can you point us to documentation of that statement (minuted 
decisions in WGs)?

Not to pick on you personally, but in my years of standardization I've 
been through a number of cases where people have made statements about 
what other groups were going to do in the really near future, and when 
investigating, it has turned out that the other groups varied between 
"well, someone suggested the idea, and it seemed like a good one, we'll 
discuss it some year", "that's been suggested, but we're not going to do 
it" and "I've never heard of that".

Received on Sunday, 7 April 2013 16:03:27 UTC