Merge pull request #12109 from zedascouves/master
Add camera choice option to QR scanner field
This commit is contained in:
commit
6a76fb4d90
|
@ -3598,6 +3598,22 @@
|
|||
"value": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "select",
|
||||
"label": "Preferred camera",
|
||||
"key": "preferredCamera",
|
||||
"defaultValue": "environment",
|
||||
"options": [
|
||||
{
|
||||
"label": "Front",
|
||||
"value": "user"
|
||||
},
|
||||
{
|
||||
"label": "Back",
|
||||
"value": "environment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "event",
|
||||
"label": "On change",
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
export let beepOnScan = false
|
||||
export let beepFrequency = 2637
|
||||
export let customFrequency = 1046
|
||||
export let preferredCamera = "environment"
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
|
@ -20,7 +21,7 @@
|
|||
let cameraEnabled
|
||||
let cameraStarted = false
|
||||
let html5QrCode
|
||||
let cameraSetting = { facingMode: "environment" }
|
||||
let cameraSetting = { facingMode: preferredCamera }
|
||||
let cameraConfig = {
|
||||
fps: 25,
|
||||
qrbox: { width: 250, height: 250 },
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
export let beepOnScan
|
||||
export let beepFrequency
|
||||
export let customFrequency
|
||||
export let preferredCamera
|
||||
|
||||
let fieldState
|
||||
let fieldApi
|
||||
|
@ -48,6 +49,7 @@
|
|||
{beepOnScan}
|
||||
{beepFrequency}
|
||||
{customFrequency}
|
||||
{preferredCamera}
|
||||
/>
|
||||
{/if}
|
||||
</Field>
|
||||
|
|
Loading…
Reference in New Issue