Merged master and fixed integrationtests

This commit is contained in:
Christoph Oberhofer
2017-08-10 10:43:43 +02:00
11 changed files with 287 additions and 90 deletions
+28 -12
View File
@@ -3535,7 +3535,9 @@ function initCamera(video, constraints) {
return (0, _mediaDevices.getUserMedia)(constraints).then(function (stream) {
return new Promise(function (resolve) {
streamRef = stream;
video.setAttribute("autoplay", 'true');
video.setAttribute("autoplay", true);
video.setAttribute('muted', true);
video.setAttribute('playsinline', true);
video.srcObject = stream;
video.addEventListener('loadedmetadata', function () {
video.play();
@@ -3579,6 +3581,15 @@ function enumerateVideoDevices() {
});
}
function getActiveTrack() {
if (streamRef) {
var tracks = streamRef.getVideoTracks();
if (tracks && tracks.length) {
return tracks[0];
}
}
}
exports.default = {
request: function request(video, videoConstraints) {
return pickConstraints(videoConstraints).then(initCamera.bind(null, video));
@@ -3592,13 +3603,10 @@ exports.default = {
},
enumerateVideoDevices: enumerateVideoDevices,
getActiveStreamLabel: function getActiveStreamLabel() {
if (streamRef) {
var tracks = streamRef.getVideoTracks();
if (tracks && tracks.length) {
return tracks[0].label;
}
}
}
var track = getActiveTrack();
return track ? track.label : '';
},
getActiveTrack: getActiveTrack
};
/***/ }),
@@ -10053,11 +10061,19 @@ function createScanner(pixelCapturer) {
}
function calculateClipping(canvasSize) {
var area = _config.detector.area;
var patchSize = _config.locator.patchSize || "medium";
var halfSample = _config.locator.halfSample || true;
if (_config.detector && _config.detector.area) {
var area = _config.detector.area;
var patchSize = _config.locator.patchSize || "medium";
var halfSample = _config.locator.halfSample || true;
return _checkImageConstraints({ area: area, patchSize: patchSize, canvasSize: canvasSize, halfSample: halfSample });
return _checkImageConstraints({ area: area, patchSize: patchSize, canvasSize: canvasSize, halfSample: halfSample });
}
return {
x: 0,
y: 0,
width: canvasSize.width,
height: canvasSize.height
};
}
function update() {
+1 -1
View File
File diff suppressed because one or more lines are too long