Re: Constraints and MediaRecorder

My use case for constraints is always the case where the JS application
(not the UA) has to make the call between:

- I'd like things to be like that, but I'd rather have something working
than nothing
- I have to have it like that, and I can't live with having it any other way

The somewhat OBE case that comes to mind first is if we set a constraint of

[mandatory or optional]:
   width: 640
   height: 480

and the only available codec is H.261, which can't do more than 352x288.

Would you rather have grainy video or no video? Only the application
knows, and for the UA to do what the application wants, there has to be
API expressiveness that allows the UA to express what it wants.


On 02/01/2014 12:38 PM, Robert O'Callahan wrote:
> I'm skeptical of the Constraints API in general, but I think
> MediaRecorder at least doesn't seem to need it.
>
> Suppose we had a MediaRecorderOptions dictionary like so:
> dictionary MediaRecorderOptions {
>   DOMString mimeType;
>   unsigned long width;
>   unsigned long height;
> };
> and pass it as an additional argument to the constructor. Further
> suppose we specify that any video frames are aspect-preserving-scaled
> to fit within width x height if both are specified, or if only one is
> specified then the video frames are aspect-preserving-scaled to that
> dimension. The mimeType is used if supported, otherwise the UA ignores
> it and makes its own choice.
>
> What are the use-cases that approach fails to solve? Maybe there are
> some, but the usability penalty going from
> var mr = new MediaRecorder(stream, {mimeType:"audio/opus"});
> to
> var mr = new MediaRecorder(stream);
> mr.applyConstraints({optional:[{mimeType:"audio/opus"}]}, function
> onsuccess() { ... });
> (in particular going from sync to async) is annoying. Not to mention
> the spec and WebIDL issues of indirecting through Constraints and
> pulling in that machinery.
>
> Rob
> -- 
> Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny 
> eovni le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha
> iids  teoa stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e 
> tfaokreg iyvoeunr, 'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt
> hwea lmka'n?  gBoutt  uIp  waanndt  wyeonut  thoo mken.o w  *
> *


-- 
Surveillance is pervasive. Go Dark.

Received on Monday, 3 February 2014 03:59:42 UTC