Skip to content

Commit

Permalink
bumps version and updates dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciro S. Costa committed Aug 26, 2014
1 parent ad875ce commit 1643c76
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qcode-decoder",
"main": "build/main.min.js",
"description": "Decodes QRCode in the browser and node",
"version": "0.0.5",
"version": "0.0.6",
"homepage": "https://github.com/cirocosta/qcode-decoder",
"authors": [
"Ciro S. Costa <[email protected]>"
Expand Down
44 changes: 28 additions & 16 deletions build/qcode-decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3873,20 +3873,29 @@ QRCodeDecoder.prototype._captureToCanvas = function () {
clearTimeout(this.tmrCapture);
}

if (!this.videoDimensions && this.videoElem.videoWidth && this.videoElem.videoHeight) {
if (!this.videoDimensions &&
this.videoElem.videoWidth &&
this.videoElem.videoHeight) {

this.videoDimensions = {
w: this.videoElem.videoWidth,
h: this.videoElem.videoHeight
};
this.prepareCanvas(this.canvasElem, this.videoDimensions.w, this.videoDimensions.h);

this.prepareCanvas(this.canvasElem,
this.videoDimensions.w,
this.videoDimensions.h);
}

if (this.videoDimensions) {
var gCtx = this.canvasElem.getContext("2d");
gCtx.clearRect(0, 0, this.videoElem.videoWidth, this.videoElem.videoHeight);
gCtx.clearRect(0, 0, this.videoElem.videoWidth,
this.videoElem.videoHeight);

try{
gCtx.drawImage(this.videoElem, 0, 0,this.videoDimensions.w, this.videoDimensions.h);
gCtx.drawImage(this.videoElem, 0, 0,
this.videoDimensions.w,
this.videoDimensions.h);
qrcode.decode();
return;
}
Expand Down Expand Up @@ -3927,7 +3936,7 @@ QRCodeDecoder.prototype.isCanvasSupported = function () {
*/
QRCodeDecoder.prototype.prepareVideo = function(videoElem, errcb) {
var scope = this;

this.stop();

navigator.getUserMedia = navigator.getUserMedia ||
Expand All @@ -3949,10 +3958,11 @@ QRCodeDecoder.prototype.prepareVideo = function(videoElem, errcb) {
console.log('Couldn\'t get video from camera');
}
};

/**
+ * Releases a video stream that was being captured by prepareToVideo
+ */

/**
* Releases a video stream that was being
* captured by prepareToVideo
*/
QRCodeDecoder.prototype.stop = function() {
if (this.stream) {
this.stream.stop();
Expand All @@ -3968,12 +3978,13 @@ QRCodeDecoder.prototype.stop = function() {
/**
* Sets the sourceId for the camera to use.
*
* The sourceId can be found using the getVideoSources
* function on a browser that supports it (currently
* only Chrome).
*
* @param {String} sourceId The id of the video
* source you want to use (or false to use the current default)
* The sourceId can be found using the
* getVideoSources function on a browser that
* supports it (currently only Chrome).
*
* @param {String} sourceId The id of the
* video source you want to use (or false to use
* the current default)
*/
QRCodeDecoder.prototype.setSourceId = function (sourceId) {
if (sourceId) {
Expand All @@ -3996,7 +4007,8 @@ QRCodeDecoder.prototype.setDecoderCallback = function (cb) {
};

/**
* Gets a list of all available video sources on the device
* Gets a list of all available video sources on
* the device
*/
QRCodeDecoder.prototype.getVideoSources = function(cb) {
var sources = [];
Expand Down
2 changes: 1 addition & 1 deletion build/qcode-decoder.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/vendor/jsqrcode.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qcode-decoder",
"version": "0.0.5",
"version": "0.0.6",
"description": "Decodes QRCode in the Browser and Node",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 1643c76

Please sign in to comment.