vue-qrcode-reader
Advanced tools
Comparing version 2.3.2-alpha.2 to 2.3.2
{ | ||
"name": "vue-qrcode-reader", | ||
"description": "A set of Vue.js components for detecting and decoding QR codes.", | ||
"version": "2.3.2-alpha.2", | ||
"version": "2.3.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Niklas Gruhn", |
import adapterFactory from "webrtc-adapter/src/js/adapter_factory.js"; | ||
import { StreamApiNotSupportedError, InsecureContextError } from "./errors.js"; | ||
import { imageDataFromVideo } from "./image-data.js"; | ||
import { eventOn, timeout } from "callforth"; | ||
import { eventOn } from "callforth"; | ||
@@ -22,2 +22,3 @@ class Camera { | ||
const [track] = this.stream.getVideoTracks(); | ||
return track.getCapabilities(); | ||
@@ -124,14 +125,8 @@ } | ||
// According to: https://oberhofer.co/mediastreamtrack-and-its-capabilities/#queryingcapabilities | ||
// On some devices, getCapabilities only returns a non-empty object after | ||
// some delay. There is no appropriate event so we have to add a constant timeout | ||
await timeout(500); | ||
if (torch) { | ||
const [track] = stream.getVideoTracks(); | ||
const capabilities = track.getCapabilities(); | ||
if (capabilities.torch) { | ||
track.applyConstraints({ advanced: [{ torch: true }] }); | ||
} else { | ||
try { | ||
await track.applyConstraints({ advanced: [{ torch: true }] }); | ||
} catch (error) { | ||
console.warn("device does not support torch capability"); | ||
@@ -138,0 +133,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
578924
445