capacitor-camera-preview
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -14,3 +14,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
name: "CameraPreview", | ||
platforms: ["web"] | ||
platforms: ["web"], | ||
}); | ||
@@ -36,3 +36,3 @@ } | ||
resolve(); | ||
}, err => { | ||
}, (err) => { | ||
reject(err); | ||
@@ -52,19 +52,9 @@ }); | ||
video.pause(); | ||
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { | ||
// Not adding `{ audio: true }` since we only want video now | ||
navigator.mediaDevices | ||
.getUserMedia({ video: true }) | ||
.then(function (stream) { | ||
//video.src = window.URL.createObjectURL(stream); | ||
const tracks = stream.getTracks(); | ||
console.log(tracks); | ||
tracks.forEach(track => { | ||
track.stop(); | ||
stream.removeTrack(track); | ||
}); | ||
video.src = ""; | ||
video.pause(); | ||
video.parentNode.removeChild(video); | ||
}); | ||
const st = video.srcObject; | ||
const tracks = st.getTracks(); | ||
for (var i = 0; i < tracks.length; i++) { | ||
var track = tracks[i]; | ||
track.stop(); | ||
} | ||
video.srcObject = null; | ||
}); | ||
@@ -85,3 +75,3 @@ } | ||
.toDataURL("image/png") | ||
.replace("data:image/png;base64,", "") | ||
.replace("data:image/png;base64,", ""), | ||
}); | ||
@@ -88,0 +78,0 @@ }); |
{ | ||
"name": "capacitor-camera-preview", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Camera preview", | ||
@@ -5,0 +5,0 @@ "main": "dist/esm/index.js", |
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
58
239977
109