|
|
@@ -103,6 +103,7 @@ function setResolutionConstraints(constraints, resolution) {
|
|
103
|
103
|
* @param {string} options.desktopStream
|
|
104
|
104
|
* @param {string} options.cameraDeviceId
|
|
105
|
105
|
* @param {string} options.micDeviceId
|
|
|
106
|
+ * @param {'user'|'environment'} options.facingMode
|
|
106
|
107
|
* @param {bool} firefox_fake_device
|
|
107
|
108
|
*/
|
|
108
|
109
|
function getConstraints(um, options) {
|
|
|
@@ -122,7 +123,10 @@ function getConstraints(um, options) {
|
|
122
|
123
|
} else {
|
|
123
|
124
|
// Prefer the front i.e. user-facing camera (to the back i.e.
|
|
124
|
125
|
// environment-facing camera, for example).
|
|
125
|
|
- constraints.video.facingMode = 'user';
|
|
|
126
|
+ // TODO: Maybe use "exact" syntax if options.facingMode is defined,
|
|
|
127
|
+ // but this probably needs to be decided when updating other
|
|
|
128
|
+ // constraints, as we currently don't use "exact" syntax anywhere.
|
|
|
129
|
+ constraints.video.facingMode = options.facingMode || 'user';
|
|
126
|
130
|
}
|
|
127
|
131
|
|
|
128
|
132
|
constraints.video.optional.push({ googLeakyBucket: true });
|