提交 6749330a 编写于 作者: N nicolo.carpignoli

changed source getusermedia constraints

上级 1e4a1215
......@@ -3140,21 +3140,21 @@ ARjs.Source.prototype._initSourceWebcam = function (onReady, onError) {
// get available devices
navigator.mediaDevices.enumerateDevices().then(function (devices) {
var userMediaConstraints = {
audio: false,
video: true
};
if (window.innerWidth < 800) {
var width = (window.innerWidth < window.innerHeight) ? 480 : 640;
userMediaConstraints = {
audio: false,
video: {
facingMode: 'environment',
width: {
ideal: _this.parameters.sourceWidth,
// min: 1024,
// max: 1920
width: { min: width, max: width }
},
height: {
ideal: _this.parameters.sourceHeight,
// min: 776,
// max: 1080
}
}
};
}
if (null !== _this.parameters.deviceId) {
userMediaConstraints.video.deviceId = {
......
此差异已折叠。
......@@ -3140,21 +3140,21 @@ ARjs.Source.prototype._initSourceWebcam = function (onReady, onError) {
// get available devices
navigator.mediaDevices.enumerateDevices().then(function (devices) {
var userMediaConstraints = {
audio: false,
video: true
};
if (window.innerWidth < 800) {
var width = (window.innerWidth < window.innerHeight) ? 480 : 640;
userMediaConstraints = {
audio: false,
video: {
facingMode: 'environment',
width: {
ideal: _this.parameters.sourceWidth,
// min: 1024,
// max: 1920
width: { min: width, max: width }
},
height: {
ideal: _this.parameters.sourceHeight,
// min: 776,
// max: 1080
}
}
};
}
if (null !== _this.parameters.deviceId) {
userMediaConstraints.video.deviceId = {
......
......@@ -3140,21 +3140,21 @@ ARjs.Source.prototype._initSourceWebcam = function (onReady, onError) {
// get available devices
navigator.mediaDevices.enumerateDevices().then(function (devices) {
var userMediaConstraints = {
audio: false,
video: true
};
if (window.innerWidth < 800) {
var width = (window.innerWidth < window.innerHeight) ? 480 : 640;
userMediaConstraints = {
audio: false,
video: {
facingMode: 'environment',
width: {
ideal: _this.parameters.sourceWidth,
// min: 1024,
// max: 1920
width: { min: width, max: width }
},
height: {
ideal: _this.parameters.sourceHeight,
// min: 776,
// max: 1080
}
}
};
}
if (null !== _this.parameters.deviceId) {
userMediaConstraints.video.deviceId = {
......
此差异已折叠。
此差异已折叠。
......@@ -181,21 +181,21 @@ ARjs.Source.prototype._initSourceWebcam = function (onReady, onError) {
// get available devices
navigator.mediaDevices.enumerateDevices().then(function (devices) {
var userMediaConstraints = {
audio: false,
video: true
};
if (window.innerWidth < 800) {
var width = (window.innerWidth < window.innerHeight) ? 480 : 640;
userMediaConstraints = {
audio: false,
video: {
facingMode: 'environment',
width: {
ideal: _this.parameters.sourceWidth,
// min: 1024,
// max: 1920
width: { min: width, max: width }
},
height: {
ideal: _this.parameters.sourceHeight,
// min: 776,
// max: 1080
}
}
};
}
if (null !== _this.parameters.deviceId) {
userMediaConstraints.video.deviceId = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册