W3C home > Mailing lists > Public > public-media-capture@w3.org > March 2012

Proposal on how to introduce constraints in getUserMedia()

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Thu, 22 Mar 2012 13:15:52 +0100
Message-ID: <4F6B17F8.90000@ericsson.com>
To: "public-media-capture@w3.org" <public-media-capture@w3.org>
Hi

There's a thread on public-webrtc [1] about how to focus our work and 
prioritize functionality for version one. Parts of that discussion has 
moved on to deal with how constraints can be introduced in 
getUserMedia(). This mail is intended as input to that discussion but 
this list is more appropriate for such a discussion.

---

One way forward could be to have the constraints dictionary as a member 
of the existing MediaStreamOptions dictionary.

void getUserMedia (MediaStreamOptions? options,
                    NavigatorUserMediaSuccessCallback? successCb,
                    optional NavigatorUserMediaErrorCallback? errorCb);

dictionary MediaStreamOptions {
     boolean audio;
     boolean video;
     MediaStreamConstraints? constraints;
};

This actually has some benefits:
- We can add the constraints dictionary member to MediaStreamOptions at 
any time without breaking existing code.
- Constraints have a specific syntax (described in the constraints 
registry draft [2]) so we can keep the simple "audio" and "video" keys 
if we have them in a separate dictionary.
- We will be more aligned with DOM APIs such as Geolocation which have 
an optional structure for advanced options.

BR
Adam

---
[1] http://lists.w3.org/Archives/Public/public-webrtc/2012Mar/0075.html

[2] 
http://tools.ietf.org/id/draft-burnett-rtcweb-constraints-registry-00.txt
Received on Thursday, 22 March 2012 12:21:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:14:59 GMT