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

changed source getusermedia constraints

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