cameraclick
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -80,4 +80,26 @@ function CameraClick(element, camOptions) { | ||
videoCanvas.srcObject = null; | ||
[...mediaTracks.getTracks()].map(track => track.stop()); | ||
/* global webkitMediaStream:true */ | ||
var MediaStream = window.MediaStream; | ||
if (typeof MediaStream === 'undefined' && typeof webkitMediaStream !== 'undefined') { | ||
MediaStream = webkitMediaStream; | ||
} | ||
if (typeof MediaStream !== 'undefined' && !('stop' in MediaStream.prototype)) { | ||
MediaStream.prototype.stop = function () { | ||
Array.from(this.getTracks()).forEach(function (track) { | ||
console.log('track: ', track); | ||
if (track) { | ||
track.stop(); | ||
} | ||
}); | ||
}; | ||
} | ||
try { | ||
mediaTracks.stop(); | ||
} catch (e) {} | ||
if (typeof camOptions.onClose === 'function' && activateCallback) { | ||
@@ -84,0 +106,0 @@ camOptions.onClose(); |
{ | ||
"name": "cameraclick", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Simple script to capture images from your browser", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25340
228
0