Re: Can constraints constrain by default?

On 4/2/14 10:27 PM, Jim Barnett wrote:
> One problem though is that in the current spec we define sourceType 
> and sourceID to apply to both audio and video tracks.   It would be 
> pretty annoying to have sourceType default to 'camera' for an audio 
> track.

I'm not saying add defaults to everything!

Or are you saying use the existing sourceType instead of 
chromeMediaSource? That might work.

We could solve the default problem like this (I forgot to define 
sourceType in WebIDL earlier btw):

enum SourceTypeEnum {
     "default",
     "microphone",
     "camera",
     "screen",
     "application"
};

dictionary MediaTrackConstraintSet {
...
     ConstrainSourceTypesourceType = "default";
};

typedef (SourceTypeEnum or sequence<SourceTypeEnum>) ConstrainSourceType;

and interpret "default" as "camera" for video and "microphone" for audio.
Whereas all getters would fill in the explicit type.

That should give the right effect I think and make it usable for 
chromeMediaSource-like needs.

.: Jan-Ivar :.

PS: SourceTypeEnum has a "none" value today. Why? Seems like an overload 
to me.

Received on Thursday, 3 April 2014 03:12:10 UTC