mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 13:51:37 +08:00
Added test for releasing camera, fixed code-style
This commit is contained in:
@@ -93,10 +93,11 @@ define(function() {
|
||||
request(video, callback);
|
||||
},
|
||||
release : function() {
|
||||
var tracks = streamRef && streamRef.getVideoTracks();
|
||||
if (tracks.length)
|
||||
tracks[0].stop();
|
||||
streamRef = null;
|
||||
var tracks = streamRef && streamRef.getVideoTracks();
|
||||
if (tracks.length) {
|
||||
tracks[0].stop();
|
||||
}
|
||||
streamRef = null;
|
||||
}
|
||||
};
|
||||
});
|
||||
+2
-2
@@ -191,8 +191,8 @@ function(Code128Reader, EANReader, InputStream, ImageWrapper, BarcodeLocator, Ba
|
||||
},
|
||||
stop : function() {
|
||||
_stopped = true;
|
||||
if (_config.inputStream.type == "LiveStream") {
|
||||
CameraAccess.release();
|
||||
if (_config.inputStream.type === "LiveStream") {
|
||||
CameraAccess.release();
|
||||
}
|
||||
},
|
||||
onDetected : function(callback) {
|
||||
|
||||
Reference in New Issue
Block a user