From b34bc1102274051a2ce3909789924ba03631e837 Mon Sep 17 00:00:00 2001 From: Thomas Manson Date: Thu, 28 Apr 2016 08:02:14 +0200 Subject: [PATCH] $window.localMediaStream.stop(); not available on Chrome This don't work anymore in Google Chrome https://developers.google.com/web/updates/2015/07/mediastream-deprecations?hl=en#stop-ended-and-active $window.localMediaStream.stop(); and needs to be replaced by this : (which works one Firefox & Chrome) $window.localMediaStream.getTracks()[0].stop(); --- qr-scanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qr-scanner.js b/qr-scanner.js index 6f3a309..e0ba45a 100644 --- a/qr-scanner.js +++ b/qr-scanner.js @@ -72,7 +72,7 @@ angular.module('qrScanner', ["ng"]).directive('qrScanner', ['$interval', '$windo element.bind('$destroy', function() { if ($window.localMediaStream) { - $window.localMediaStream.stop(); + $window.localMediaStream.getTracks()[0].stop(); } if (stopScan) { $interval.cancel(stopScan);