Re: Can constraints constrain by default?

sourceType is what's in the spec right now.  chromeMediaSource is a 
platform-specific extension as far as I know.  If we can get different 
defaults for audio and video, that should work. Presumably the UA must 
call the error callback if someone explicitly specifies 
sourceType="microphone" for 'video', etc.

- Jim

P.S.  On the issue of 'video2', one option to do would be to have 
'audio', 'video' and 'other', where 'other' takes an array of 
MediaTrackConstraintSet, where each one defines its device type via 
'sourceType'.  Simple apps wouldn't need it, but more complex apps could 
specify as many devices of as many types as they wanted .
On 4/2/2014 11:11 PM, Jan-Ivar Bruaroey wrote:
> 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.
>

-- 
Jim Barnett
Genesys

Received on Thursday, 3 April 2014 14:27:21 UTC