vue-qrcode-reader
Advanced tools
Comparing version 2.3.12 to 2.3.13
{ | ||
"name": "vue-qrcode-reader", | ||
"description": "A set of Vue.js components for detecting and decoding QR codes.", | ||
"version": "2.3.12", | ||
"version": "2.3.13", | ||
"author": { | ||
@@ -34,3 +34,4 @@ "name": "Niklas Gruhn", | ||
"core-js": "^3.6.5", | ||
"vue": "^2.6.11" | ||
"vue": "^2.6.11", | ||
"webrtc-adapter": "7.7.0" | ||
}, | ||
@@ -46,2 +47,3 @@ "devDependencies": { | ||
"eslint-plugin-vue": "^6.2.2", | ||
"husky": "^4.2.5", | ||
"lint-staged": "^9.5.0", | ||
@@ -48,0 +50,0 @@ "prettier": "^1.19.1", |
import { StreamApiNotSupportedError, InsecureContextError } from "./errors.js"; | ||
import { imageDataFromVideo } from "./image-data.js"; | ||
import { eventOn, timeout } from "callforth"; | ||
import { indempotent } from "./util.js" | ||
import shimGetUserMedia from "./shimGetUserMedia"; | ||
@@ -67,11 +67,2 @@ class Camera { | ||
const applyWebRTCShim = indempotent(() => { | ||
const script = document.createElement("script"); | ||
script.src = "https://webrtc.github.io/adapter/adapter-7.6.3.js"; | ||
document.head.appendChild(script); | ||
return eventOn(script, "load"); | ||
}); | ||
export default async function(videoEl, { camera, torch }) { | ||
@@ -94,3 +85,3 @@ // At least in Chrome `navigator.mediaDevices` is undefined when the page is | ||
// is not available during SSR. So we lazily apply this shim at runtime. | ||
await applyWebRTCShim() | ||
await shimGetUserMedia(); | ||
@@ -102,3 +93,3 @@ const constraints = { | ||
height: { min: 240, ideal: 480, max: 1080 }, | ||
...(await narrowDownFacingMode(camera)), | ||
...(await narrowDownFacingMode(camera)) | ||
} | ||
@@ -105,0 +96,0 @@ }; |
@@ -1,16 +0,15 @@ | ||
export const indempotent = action => { | ||
let called = false | ||
let result = undefined | ||
let called = false; | ||
let result = undefined; | ||
return (...args) => { | ||
if (called) { | ||
return result | ||
return result; | ||
} else { | ||
result = action(...args) | ||
called = true | ||
result = action(...args); | ||
called = true; | ||
return result | ||
return result; | ||
} | ||
} | ||
} | ||
}; | ||
}; |
module.exports = { | ||
css: { extract: false }, | ||
lintOnSave: false | ||
lintOnSave: false, | ||
transpileDependencies: ["webrtc-adapter"] | ||
}; |
Sorry, the diff of this file is too big to display
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 not supported yet
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
3259737
79
19700
4
14
+ Addedwebrtc-adapter@7.7.0
+ Addedrtcpeerconnection-shim@1.2.15(transitive)
+ Addedsdp@2.12.0(transitive)
+ Addedwebrtc-adapter@7.7.0(transitive)