参考 W3C Media Capture and Stream 2014.5.7 草案
2014.5.7 W3C Media Capture and Stream 草案添加了 “4.3.5 MediaTrackConstraints”:
dictionary MediaTrackConstraintSet {
ConstrainLong
width;
ConstrainLong
height;
ConstrainDouble
aspectRatio;
ConstrainDouble
frameRate;
ConstrainVideoFacingMode facingMode;
ConstrainDouble
volume;
ConstrainLong
sampleRate;
ConstrainLong
sampleSize;
boolean echoCancelation;
ConstrainDOMString
sourceId;
};
以后,如果浏览器添加这个支持,那么创建 usermedia 的时候,js 就可以指定前后左右摄像头以及摄像头的分辨率了。