Compare commits

...

16 Commits

Author SHA1 Message Date
Eric Blade 862df88970
Merge pull request #369 from LasseRafn/patch-1
Update README.md
6 years ago
Lasse Rafn 262217b924
Update README.md
Modern iOS Safari supports this
6 years ago
Eric Blade e96eb9f788
Merge pull request #344 from xvzf/add-typescript-module
Declare module so webpack can do its work
7 years ago
Matthias Riegler 4c73d76692
Declare module so webpack can do its work 7 years ago
Eric Blade 42b5382510
Merge pull request #234 from danmana/typescript
Update typings to match v0.12.1
7 years ago
kieat 78179ce570 Allow drawRect to accept and handle style.lineWidth (#315)
Allow drawRect to accept and handle style.lineWidth
7 years ago
Tomáš Hübelbauer 271be5d3ff
Merge branch 'master' into typescript 7 years ago
Rudolph Gottesheim 0a295f537e Add "typings" key to package.json (#170)
https://www.typescriptlang.org/docs/handbook/module-resolution.html#how-typescript-resolves-modules
7 years ago
José Pedro Silva 1adba48ddc Bower & Typings Support (#171)
* chore(bower): update bower definitions

* chore(typings): update typings pointer on package.json
7 years ago
Tomáš Hübelbauer 5817a3daba
Harmonize Node and Bower versions (#304) 7 years ago
Eric Blade a4de46f9a9
Merge pull request #302 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
7 years ago
The Gitter Badger 9c24fc78b2 Add Gitter badge 7 years ago
Dan.Manastireanu 12a74d03d4 Add missing typing for inputStream target 8 years ago
Dan Manastireanu a6d370a9c1 Update typings to match v0.12.1 8 years ago
Christoph Oberhofer eff0c5ad12 0.12.1 8 years ago
Christoph Oberhofer e8352c7017 Fixed error in live_example; Working for iOS in Safari 11 beta 8 years ago

@ -1,7 +1,9 @@
quaggaJS quaggaJS
======== ========
- [Changelog](#changelog) (2017-06-06) [![Join the chat at https://gitter.im/quaggaJS/Lobby](https://badges.gitter.im/quaggaJS/Lobby.svg)](https://gitter.im/quaggaJS/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
- [Changelog](#changelog) (2017-06-07)
- [Browser Support](#browser-support) - [Browser Support](#browser-support)
- [Installing](#installing) - [Installing](#installing)
- [Getting Started](#gettingstarted) - [Getting Started](#gettingstarted)
@ -89,7 +91,7 @@ The above condition evaluates to:
| Chrome | `true` | | Chrome | `true` |
| Firefox | `true` | | Firefox | `true` |
| IE 11 | `false` | | IE 11 | `false` |
| Safari iOS | `false` | | Safari iOS | `true` |
## <a name="installing">Installing</a> ## <a name="installing">Installing</a>
@ -703,6 +705,13 @@ on the ``singleChannel`` flag in the configuration when using ``decodeSingle``.
## <a name="changelog">Changelog</a> ## <a name="changelog">Changelog</a>
### 2017-06-07
- Improvements
- added `muted` and `playsinline` to `<video/>` to make it work for Safari 11
Beta (even iOS)
- Fixes
- Fixed [example/live_w_locator.js](https://github.com/serratus/quaggaJS/blob/master/example/live_w_locator.js)
### 2017-06-06 ### 2017-06-06
- Features - Features
- Support for Standard 2of5 barcodes (See - Support for Standard 2of5 barcodes (See

@ -1,6 +1,6 @@
{ {
"name": "quagga", "name": "quagga",
"version": "0.6.14", "version": "0.12.1",
"description": "An advanced barcode-scanner written in JavaScript", "description": "An advanced barcode-scanner written in JavaScript",
"main": "dist/quagga.js", "main": "dist/quagga.js",
"ignore": [ "ignore": [

6
dist/quagga.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -81,7 +81,6 @@ $(function() {
} }
return; return;
} }
node.parentNode.style.display = 'none';
}, },
initCameraSelection: function(){ initCameraSelection: function(){
var streamLabel = Quagga.CameraAccess.getActiveStreamLabel(); var streamLabel = Quagga.CameraAccess.getActiveStreamLabel();

File diff suppressed because one or more lines are too long

@ -1,9 +1,11 @@
{ {
"name": "quagga", "name": "quagga",
"version": "0.12.0", "version": "0.12.1",
"description": "An advanced barcode-scanner written in JavaScript", "description": "An advanced barcode-scanner written in JavaScript",
"main": "lib/quagga.js", "main": "lib/quagga.js",
"typings": "type-definitions/quagga.d.ts",
"browser": "dist/quagga.min.js", "browser": "dist/quagga.min.js",
"typings": "type-definitions/quagga.d.ts",
"devDependencies": { "devDependencies": {
"async": "^1.4.2", "async": "^1.4.2",
"babel-cli": "^6.5.1", "babel-cli": "^6.5.1",

@ -2,7 +2,7 @@ export default {
drawRect: function(pos, size, ctx, style){ drawRect: function(pos, size, ctx, style){
ctx.strokeStyle = style.color; ctx.strokeStyle = style.color;
ctx.fillStyle = style.color; ctx.fillStyle = style.color;
ctx.lineWidth = 1; ctx.lineWidth = style.lineWidth || 1;
ctx.beginPath(); ctx.beginPath();
ctx.strokeRect(pos.x, pos.y, size.x, size.y); ctx.strokeRect(pos.x, pos.y, size.x, size.y);
}, },

@ -42,7 +42,9 @@ function initCamera(video, constraints) {
.then((stream) => { .then((stream) => {
return new Promise((resolve) => { return new Promise((resolve) => {
streamRef = stream; streamRef = stream;
video.setAttribute("autoplay", 'true'); video.setAttribute("autoplay", true);
video.setAttribute('muted', true);
video.setAttribute('playsinline', true);
video.srcObject = stream; video.srcObject = stream;
video.addEventListener('loadedmetadata', () => { video.addEventListener('loadedmetadata', () => {
video.play(); video.play();

@ -1,9 +1,11 @@
// Type definitions for QuaggaJS v2015.05.20 Project: // Type definitions for QuaggaJS v0.12.1 (2017-10-19)
// http://serratus.github.io/quaggaJS/ Definitions by: Cam Birch, Peter // Project: http://serratus.github.io/quaggaJS/
// Horwood aka Madman Pierre // Definitions by: Cam Birch, Peter Horwood aka Madman Pierre, Dan Manastireanu <https://github.com/danmana>
declare var Quagga: QuaggaJSStatic; declare module "quagga" {
export default Quagga; var Quagga: QuaggaJSStatic;
export default Quagga;
}
interface QuaggaJSStatic { interface QuaggaJSStatic {
/** /**
@ -72,7 +74,7 @@ interface QuaggaJSStatic {
ResultCollector: QuaggaJSResultCollector; ResultCollector: QuaggaJSResultCollector;
registerResultCollector(resultCollector: QuaggaJSResultCollector): void; registerResultCollector(resultCollector: QuaggaJSResultCollector): void;
setReaders(readers: any): void; setReaders(readers: (QuaggaJSReaderConfig | string)[]): void;
/** /**
* In contrast to the calls described * In contrast to the calls described
@ -108,6 +110,24 @@ interface QuaggaJSStatic {
overlay: HTMLCanvasElement overlay: HTMLCanvasElement
} }
}; };
CameraAccess: QuaggaJSCameraAccess;
}
/**
* Used for accessing information about the active stream track and available video devices.
*/
interface QuaggaJSCameraAccess {
request(video: HTMLVideoElement, videoConstraints: QuaggaJSConstraints): Promise<void>;
release(): void;
enumerateVideoDevices(): Promise<MediaDeviceInfo[]>;
getActiveStreamLabel(): string;
getActiveTrack(): MediaStreamTrack;
} }
/** /**
@ -217,7 +237,7 @@ interface QuaggaJSResultCollector {
/* /*
* a static function that returns you a ResultCollector * a static function that returns you a ResultCollector
*/ */
create?(QuaggaJSResultCollector): QuaggaJSResultCollector; create?(param: QuaggaJSResultCollector): QuaggaJSResultCollector;
getResults?(): QuaggaJSCodeResult[]; getResults?(): QuaggaJSCodeResult[];
} }
@ -291,7 +311,9 @@ interface QuaggaJSConfigObject {
* Ex: '/test/fixtures/code_128/image-001.jpg' * Ex: '/test/fixtures/code_128/image-001.jpg'
* or: 'data:image/jpg;base64,' + data * or: 'data:image/jpg;base64,' + data
*/ */
src?: string; inputStream?: { src?: string;
inputStream?: {
/** /**
* @default "Live" * @default "Live"
*/ */
@ -302,32 +324,9 @@ interface QuaggaJSConfigObject {
*/ */
type?: string; type?: string;
constraints?: { target?: HTMLElement,
/**
* @default 640
*/
width?: number;
/**
* @default 480
*/
height?: number;
/**
* In cases where height/width does not suffice
*/
aspectRatio?: number
/**
* @default "environment"
*/
facingMode?: string;
/** constraints?: QuaggaJSConstraints;
* Explicitly set the camera to the user's choice
*/
deviceId?: string
};
/** /**
* defines rectangle of the detection/localization area. Useful when you * defines rectangle of the detection/localization area. Useful when you
@ -380,11 +379,19 @@ interface QuaggaJSConfigObject {
*/ */
numOfWorkers?: number; numOfWorkers?: number;
/**
* This top-level property controls the scan-frequency of the video-stream.
* Its optional and defines the maximum number of scans per second.
* This renders useful for cases where the scan-session is long-running and
* resources such as CPU power are of concern.
*/
frequency?: number;
decoder?: { decoder?: {
/** /**
* @default [ "code_128_reader" ] * @default [ "code_128_reader" ]
*/ */
readers?: string[]; readers?: (QuaggaJSReaderConfig | string)[];
debug?: { debug?: {
/** /**
@ -406,7 +413,15 @@ interface QuaggaJSConfigObject {
* @default false * @default false
*/ */
showPattern?: boolean; showPattern?: boolean;
} };
/**
* The multiple property tells the decoder if it should continue decoding after finding a valid barcode.
* If multiple is set to true, the results will be returned as an array of result objects.
* Each object in the array will have a box, and may have a codeResult
* depending on the success of decoding the individual box.
*/
multiple?: boolean;
}; };
locator?: { locator?: {
@ -476,3 +491,40 @@ interface QuaggaJSConfigObject {
} }
}; };
} }
interface QuaggaJSConstraints {
/**
* @default 640
*/
width?: number;
/**
* @default 480
*/
height?: number;
/**
* In cases where height/width does not suffice
*/
aspectRatio?: number
/**
* @default "environment"
*/
facingMode?: string;
/**
* Explicitly set the camera to the user's choice
*/
deviceId?: string
}
/**
* Used for extending a reader with supplements (ex: EAN-2, EAN-5)
*/
interface QuaggaJSReaderConfig {
format: string;
config: {
supplements: string[];
}
}

Loading…
Cancel
Save