Skip to content

Commit 466803a

Browse files
going back to old camera constraints
1 parent fa2c8ee commit 466803a

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

three.js/src/threex/threex-artoolkitsource.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,16 @@ ARjs.Source.prototype._initSourceWebcam = function (onReady, onError) {
182182
navigator.mediaDevices.enumerateDevices().then(function (devices) {
183183
var userMediaConstraints = {
184184
audio: false,
185-
video: true
186-
};
187-
188-
if (window.innerWidth < 800) {
189-
var width = (window.innerWidth < window.innerHeight) ? 480 : 640;
190-
191-
userMediaConstraints = {
192-
audio: false,
193-
video: {
194-
facingMode: 'environment',
195-
width: { min: width, max: width }
185+
video: {
186+
facingMode: 'environment',
187+
width: {
188+
ideal: _this.parameters.sourceWidth,
196189
},
197-
};
198-
}
190+
height: {
191+
ideal: _this.parameters.sourceHeight,
192+
}
193+
}
194+
};
199195

200196
if (null !== _this.parameters.deviceId) {
201197
userMediaConstraints.video.deviceId = {

0 commit comments

Comments
 (0)