RE: constraints vs attributes

I agree that there are a legitimate questions about when to use Constraints vs dictionaries or other simpler structures.  We'll have to go through them  case by case.


-          Jim

From: Jan-Ivar Bruaroey [mailto:jib@mozilla.com]
Sent: Wednesday, November 13, 2013 5:48 PM
To: Jim Barnett; public-webrtc@w3.org
Subject: Re: constraints vs attributes

On 11/13/13 4:00 PM, Jim Barnett wrote:
Jan-Ivar,
For my edification, can you explain how the use of a dictionary lets you do the following:

1.       Ask the device what range of framerates it supports?

2.       Request that the device set a framerate between n and m frames per second

3.       Request the above, but allow the UA the choice of choosing another framerate if it can't set it to something between n and m.

I'm not challenging the use of constraints with devices. I happen to think that's their ideal use.

I was challenging the use of constraints in other areas like PeerConnection and MediaTrackTransmissionController.

What I meant was a lot of the organizational benefits of constraints come from them being built on dictionaries, which are quite useful on their own as well, in new API cases where constraints may be overkill. For example, someone wanting a property to have a min/max range, could trivially define this in a webidl dictionary, without requiring a constrainable interface for that reason alone.


 Jim

P.S.  Perhaps there's some terminological confusion here.  The question asked was when to define something as a property inside the Constrainable interface as opposed to an attribute.  The Constraint structure is only one part of that interface.

It is quite possible we have some confusion. I though this was from the MediaTrackTransmissionController conversation, where I interpreted the need to be that we want to access a relatively simple set settings.

.: Jan-Ivar :.

Received on Wednesday, 13 November 2013 23:36:07 UTC