[mediacapture-main] Does applyConstraints() wait for motor?

jan-ivar has just created a new issue for https://github.com/w3c/mediacapture-main:

== Does applyConstraints() wait for motor? ==
In https://github.com/w3c/mediacapture-image/pull/182#issuecomment-308837309 there's a JS example attempting to use `getSettings()` to wait for a camera's motor to finish panning to a desired position. Does the mediacapture spec support this? It seems unclear:

>From what I can tell given [this](https://w3c.github.io/mediacapture-main/getusermedia.html#dom-constrainablepattern-getconstraints()): *"To check which ConstraintSets are currently in effect, the application should use getSettings."* - the mediacapture spec guarantees:
```js
await track.applyConstraints({pan: {exact: pan}});
console.log(pan == track.getSettings().pan); // true
```
But this leaves no room for a motor to change: Even if `applyConstraints` were to wait for a motor to finish, there'd be a period of time where returned `getSettings()` might violate previous (still applied) constraints:
```js
await track.applyConstraints({pan: {exact: oldPan});
let p = track.applyConstraints({pan: {exact: newPan});
setInterval(() => is(track.getConstraints().pan == track.getSettings().pan));
await p;
```
AFAICT, the current spec leaves browsers no option other than for `getSettings()` to lie about the actual motor position, and instead return only the last configured setting. Was that the intent?


Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/470 using your GitHub account

Received on Friday, 23 June 2017 18:03:49 UTC