From 39af7cc07cddc8c6382ea98f9648ad2ccf430346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Severin=20St=C3=B6ckli?= Date: Tue, 22 Dec 2015 07:51:13 +0100 Subject: [PATCH] Mediastream.stop() is deprecated since Chrome 45, and does not work anymore in Chrome 47 (https://developers.google.com/web/updates/2015/07/mediastream-deprecations?hl=en) fixed stopping each track individually. See also https://developer.mozilla.org/en/docs/Web/API/MediaStream for browser compatibility. Library gulp-livereload was missing for building the sources. --- package.json | 1 + src/qcode-decoder.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5997180..abcf17d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "gulp-footer": "^1.0.5", "gulp-header": "^1.0.5", "gulp-jshint": "^1.6.1", + "gulp-livereload": "^3.8.1", "gulp-sourcemaps": "^1.1.5", "gulp-uglify": "^0.3.0", "zuul": "^1.10.2" diff --git a/src/qcode-decoder.js b/src/qcode-decoder.js index 9d3d20b..fc6336d 100644 --- a/src/qcode-decoder.js +++ b/src/qcode-decoder.js @@ -178,7 +178,7 @@ QCodeDecoder.prototype.decodeFromImage = function (img, cb) { */ QCodeDecoder.prototype.stop = function() { if (this.stream) { - this.stream.stop(); + this.stream.getTracks().forEach(function (track) { track.stop(); }); this.stream = undefined; }