mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Updated to 0.11.6
This commit is contained in:
+1
-3
@@ -134,7 +134,6 @@ GEM
|
|||||||
ethon (>= 0.7.4)
|
ethon (>= 0.7.4)
|
||||||
tzinfo (1.2.2)
|
tzinfo (1.2.2)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
wdm (0.1.1)
|
|
||||||
yajl-ruby (1.2.1)
|
yajl-ruby (1.2.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
@@ -144,7 +143,6 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
github-pages
|
github-pages
|
||||||
wdm (>= 0.1.0)
|
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.12.5
|
1.13.6
|
||||||
|
|||||||
+14000
-12860
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
@@ -66,6 +66,11 @@ showInMenu: false
|
|||||||
<option value="8">8</option>
|
<option value="8">8</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
<label>
|
||||||
|
<span>Camera</span>
|
||||||
|
<select name="input-stream_constraints" id="deviceSelection">
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div id="result_strip">
|
<div id="result_strip">
|
||||||
|
|||||||
@@ -10,9 +10,31 @@ $(function() {
|
|||||||
Quagga.start();
|
Quagga.start();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initCameraSelection: function(){
|
||||||
|
var streamLabel = Quagga.CameraAccess.getActiveStreamLabel();
|
||||||
|
|
||||||
|
return Quagga.CameraAccess.enumerateVideoDevices()
|
||||||
|
.then(function(devices) {
|
||||||
|
function pruneText(text) {
|
||||||
|
return text.length > 30 ? text.substr(0, 30) : text;
|
||||||
|
}
|
||||||
|
var $deviceSelection = document.getElementById("deviceSelection");
|
||||||
|
while ($deviceSelection.firstChild) {
|
||||||
|
$deviceSelection.removeChild($deviceSelection.firstChild);
|
||||||
|
}
|
||||||
|
devices.forEach(function(device) {
|
||||||
|
var $option = document.createElement("option");
|
||||||
|
$option.value = device.deviceId || device.id;
|
||||||
|
$option.appendChild(document.createTextNode(pruneText(device.label || device.deviceId || device.id)));
|
||||||
|
$option.selected = streamLabel === device.label;
|
||||||
|
$deviceSelection.appendChild($option);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
attachListeners: function() {
|
attachListeners: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
self.initCameraSelection();
|
||||||
$(".controls").on("click", "button.stop", function(e) {
|
$(".controls").on("click", "button.stop", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
Quagga.stop();
|
Quagga.stop();
|
||||||
@@ -36,7 +58,11 @@ $(function() {
|
|||||||
|
|
||||||
return parts.reduce(function(o, key, i) {
|
return parts.reduce(function(o, key, i) {
|
||||||
if (setter && (i + 1) === depth) {
|
if (setter && (i + 1) === depth) {
|
||||||
o[key] = val;
|
if (typeof o[key] === "object" && typeof val === "object") {
|
||||||
|
Object.assign(o[key], val);
|
||||||
|
} else {
|
||||||
|
o[key] = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return key in o ? o[key] : {};
|
return key in o ? o[key] : {};
|
||||||
}, obj);
|
}, obj);
|
||||||
@@ -67,11 +93,16 @@ $(function() {
|
|||||||
inputMapper: {
|
inputMapper: {
|
||||||
inputStream: {
|
inputStream: {
|
||||||
constraints: function(value){
|
constraints: function(value){
|
||||||
var values = value.split('x');
|
if (/^(\d+)x(\d+)$/.test(value)) {
|
||||||
return {
|
var values = value.split('x');
|
||||||
width: {min: parseInt(values[0])},
|
return {
|
||||||
height: {min: parseInt(values[1])}
|
width: {min: parseInt(values[0])},
|
||||||
|
height: {min: parseInt(values[1])}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
return {
|
||||||
|
deviceId: value
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
numOfWorkers: function(value) {
|
numOfWorkers: function(value) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ showInMenu: true
|
|||||||
quaggaJS
|
quaggaJS
|
||||||
========
|
========
|
||||||
|
|
||||||
- [Changelog](#changelog) (2016-10-03)
|
- [Changelog](#changelog) (2017-01-08)
|
||||||
- [Browser Support](#browser-support)
|
- [Browser Support](#browser-support)
|
||||||
- [Installing](#installing)
|
- [Installing](#installing)
|
||||||
- [Getting Started](#gettingstarted)
|
- [Getting Started](#gettingstarted)
|
||||||
@@ -642,6 +642,13 @@ on the ``singleChannel`` flag in the configuration when using ``decodeSingle``.
|
|||||||
|
|
||||||
## <a name="changelog">Changelog</a>
|
## <a name="changelog">Changelog</a>
|
||||||
|
|
||||||
|
### 2017-01-08
|
||||||
|
- Improvements
|
||||||
|
- Exposing `CameraAccess` module to get access to methods like
|
||||||
|
`enumerateVideoDevices` and `getActiveStreamLabel`
|
||||||
|
(see `example/live_w_locator`)
|
||||||
|
- Update to webpack 2.2 (API is still unstable)
|
||||||
|
|
||||||
### 2016-10-03
|
### 2016-10-03
|
||||||
- Fixes
|
- Fixes
|
||||||
- Fixed `facingMode` issue with Chrome >= 53 (see [#128](https://github.com/serratus/quaggaJS/issues/128))
|
- Fixed `facingMode` issue with Chrome >= 53 (see [#128](https://github.com/serratus/quaggaJS/issues/128))
|
||||||
|
|||||||
Reference in New Issue
Block a user