dynamsoft-barcode-reader-bundle 11.2.4000 → 11.4.2000-beta-202604162228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LEGAL.txt +8 -1
- package/LICENSE +1 -1
- package/README.html +541 -115
- package/README.md +628 -125
- package/dist/dbr.bundle.d.ts +1577 -2689
- package/dist/dbr.bundle.esm.js +3 -3
- package/dist/dbr.bundle.js +3 -3
- package/dist/dbr.bundle.mjs +3 -3
- package/dist/dbr.bundle.worker.js +3 -3
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread.js +1 -1
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread.wasm +0 -0
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd.js +1 -1
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd.wasm +0 -0
- package/dist/dynamsoft-barcode-reader-bundle.js +1 -1
- package/dist/dynamsoft-barcode-reader-bundle.wasm +0 -0
- package/dist/models/Code128Decoder.data +0 -0
- package/dist/models/Code39ITFDecoder.data +0 -0
- package/dist/models/DataMatrixQRCodeDeblur.data +0 -0
- package/dist/models/DataMatrixQRCodeLocalization.data +0 -0
- package/dist/models/EAN13Decoder.data +0 -0
- package/dist/models/OneDDeblur.data +0 -0
- package/dist/models/OneDLocalization.data +0 -0
- package/dist/models/PDF417Deblur.data +0 -0
- package/dist/models/PDF417Localization.data +0 -0
- package/dist/parser-resources/AADHAAR.data +0 -0
- package/dist/parser-resources/AAMVA_DL_ID.data +1 -0
- package/dist/parser-resources/GS1_AI.data +66 -0
- package/dist/parser-resources/MRTD.data +1 -0
- package/dist/parser-resources/SOUTH_AFRICA_DL.data +1 -0
- package/dist/parser-resources/VIN.data +0 -0
- package/dist/templates/DBR-PresetTemplates.json +9 -22
- package/dist/ui/barcode-scanner.ui.xml +271 -108
- package/dist/ui/dce.rtu.ui.xml +431 -0
- package/dist/ui/dce.ui.v5.xml +470 -0
- package/dist/ui/dce.ui.xml +138 -114
- package/dist/ui/dls.license.dialog.html +1 -1
- package/package.json +16 -15
- package/samples.url +1 -1
- package/API_Reference_BarcodeScanner.url +0 -2
- package/API_Reference_Foundational.url +0 -2
- package/dist/parser-resources/AADHAAR.dcpres +0 -1
- package/dist/parser-resources/AADHAAR_Map.txt +0 -3
- package/dist/parser-resources/AAMVA_DL_ID.dcpres +0 -1
- package/dist/parser-resources/AAMVA_DL_ID_WITH_MAG_STRIPE.dcpres +0 -1
- package/dist/parser-resources/AAMVA_Map.txt +0 -70
- package/dist/parser-resources/GS1_AI.dcpres +0 -1
- package/dist/parser-resources/GS1_AI_Map.txt +0 -643
- package/dist/parser-resources/MRTD_Map.txt +0 -255
- package/dist/parser-resources/MRTD_TD1_ID.dcpres +0 -1
- package/dist/parser-resources/MRTD_TD2_FRENCH_ID.dcpres +0 -1
- package/dist/parser-resources/MRTD_TD2_ID.dcpres +0 -1
- package/dist/parser-resources/MRTD_TD2_VISA.dcpres +0 -1
- package/dist/parser-resources/MRTD_TD3_PASSPORT.dcpres +0 -1
- package/dist/parser-resources/MRTD_TD3_VISA.dcpres +0 -1
- package/dist/parser-resources/SOUTH_AFRICA_DL.dcpres +0 -1
- package/dist/parser-resources/SOUTH_AFRICA_DL_Map.txt +0 -3
- package/dist/parser-resources/VIN.dcpres +0 -1
- package/dist/parser-resources/VIN_Map.txt +0 -150
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
|
|
2
|
+
<div style="position:relative;width:100%;height:100%;min-width:100px;min-height:100px;background:#000;font-family:Arial,Helvetica,sans-serif;pointer-events:none;user-select:none;">
|
|
3
|
+
<div class="dm-camera-core-container" style="width:100%;height:100%;pointer-events:initial;"></div>
|
|
4
|
+
<div class="dm-camera-mn-beep" title="beep" style="display:none;">
|
|
5
|
+
<div class="dm-camera-mn-beep-on">
|
|
6
|
+
<svg viewBox="0 0 512 512" stroke="#fff" fill="#fff">
|
|
7
|
+
<path d="M140,148 50,148 50,364 140,364 226,482 226,30Z" />
|
|
8
|
+
<path d="M260,168A128,128,0,0,1,260,344" stroke-width="16" fill="transparent"/>
|
|
9
|
+
<path d="M310,118A192,192,0,0,1,310,394" stroke-width="16" fill="transparent"/>
|
|
10
|
+
<path d="M360,68A256,256,0,0,1,360,444" stroke-width="16" fill="transparent"/>
|
|
11
|
+
</svg>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="dm-camera-mn-beep-off">
|
|
14
|
+
<svg viewBox="0 0 512 512" stroke="#fff" fill="#fff">
|
|
15
|
+
<path d="M140,148 50,148 50,364 140,364 226,482 226,30Z" />
|
|
16
|
+
<path d="M260,168 436,344" stroke-width="16"/>
|
|
17
|
+
<path d="M436,168 260,344" stroke-width="16"/>
|
|
18
|
+
</svg>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="dm-camera-mn-vibrate" title="vibrate" style="display:none;">
|
|
22
|
+
<div class="dm-camera-mn-vibrate-on">
|
|
23
|
+
<svg viewBox="0 0 512 512" stroke="#fff" fill="#fff">
|
|
24
|
+
<path d="M60,180 180,60 452,332 332,452Z" stroke-width="16" stroke-linejoin="round" fill="transparent"/>
|
|
25
|
+
<path d="M67,247 70,310 133,313 136,376 199,379 202,442 265,445" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="transparent"/>
|
|
26
|
+
<path d="M27,287 30,350 93,353 96,416 159,419 162,482 225,485" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="transparent"/>
|
|
27
|
+
<path d="M247,67 310,70 313,133 376,136 379,199 442,202 445,265" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="transparent"/>
|
|
28
|
+
<path d="M287,27 350,30 353,93 416,96 419,159 482,162 485,225" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="transparent"/>
|
|
29
|
+
</svg>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="dm-camera-mn-vibrate-off">
|
|
32
|
+
<svg viewBox="0 0 512 512" stroke="#fff" fill="#fff">
|
|
33
|
+
<path d="M60,180 180,60 452,332 332,452Z" stroke-width="16" stroke-linejoin="round" fill="transparent"/>
|
|
34
|
+
<path d="M67,247 70,310 133,313 136,376 199,379 202,442 265,445" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="transparent"/>
|
|
35
|
+
<path d="M27,287 30,350 93,353 96,416 159,419 162,482 225,485" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="transparent"/>
|
|
36
|
+
<path d="M300,122 480,122" stroke-width="16" stroke-linecap="round"/>
|
|
37
|
+
<path d="M390,32 390,212" stroke-width="16" stroke-linecap="round"/>
|
|
38
|
+
</svg>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="dm-camera-mn-zoom">- <span>1.0X</span> -</div>
|
|
42
|
+
<div class="dm-camera-mn-toast" style="display:none;"></div>
|
|
43
|
+
<div class="dm-camera-mn-camera-close" style="display:none;" title="close">
|
|
44
|
+
<svg viewBox="0 0 512 512" fill="#fff">
|
|
45
|
+
<defs>
|
|
46
|
+
<mask id="dm-camera-mn-camera-close-mask">
|
|
47
|
+
<rect width="512" height="512" fill="#fff"/>
|
|
48
|
+
<path d="M128,128 384,384" stroke-width="60" stroke="#000"/>
|
|
49
|
+
<path d="M384,128 128,384" stroke-width="60" stroke="#000"/>
|
|
50
|
+
</mask>
|
|
51
|
+
</defs>
|
|
52
|
+
<circle cx="256" cy="256" r="256" mask="url(#dm-camera-mn-camera-close-mask)"/>
|
|
53
|
+
</svg>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="dm-camera-mn-take-photo" style="display:none;" title="take photo"></div>
|
|
56
|
+
<svg class="dm-camera-mn-msg-poweredby" viewBox="0 0 94 17">
|
|
57
|
+
<path d="M0.9,14V4.3h2.3c0.6,0,1,0.1,1.4,0.3c0.3,0.2,0.6,0.5,0.7,0.9s0.2,0.8,0.2,1.4c0,0.5-0.1,0.9-0.2,1.3
|
|
58
|
+
C5.1,8.5,4.9,8.8,4.5,9.1C4.2,9.3,3.7,9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0.2,0.8-0.2
|
|
123
|
+
c0.1,0,0.2,0,0.4,0c0.1,0,0.2,0,0.3,0.1v0.6c-0.1,0-0.2,0-0.2,0c-0.1,0-0.2,0-0.2,0c-0.3,0-0.4,0.1-0.5,0.2s-0.1,0.4-0.1,0.8v0.8
|
|
124
|
+
h1.1v0.6h-1.1V14H88.2z" />
|
|
125
|
+
<path d="M92.7,14.1c-0.3,0-0.6-0.1-0.8-0.2s-0.3-0.3-0.4-0.5c-0.1-0.2-0.1-0.5-0.1-0.8V7.6h-0.9V7.1h0.9V4.9h0.9v2.1
|
|
126
|
+
h1.2v0.6h-1.2v4.8c0,0.3,0,0.6,0.1,0.7c0.1,0.1,0.2,0.2,0.5,0.2c0.1,0,0.2,0,0.2,0s0.2,0,0.3,0V14c-0.1,0-0.2,0-0.4,0.1
|
|
127
|
+
C92.9,14.1,92.8,14.1,92.7,14.1z" />
|
|
128
|
+
</svg>
|
|
129
|
+
<div class="dm-camera-mn-camera-and-resolution-settings">
|
|
130
|
+
<div class="dm-camera-mn-cameras">
|
|
131
|
+
<div class="dm-camera-mn-camera-option" data-device-id="">example camera</div>
|
|
132
|
+
</div>
|
|
133
|
+
<div class="dm-camera-mn-camera-and-resolution-bar"></div>
|
|
134
|
+
<div class="dm-camera-mn-resolutions">
|
|
135
|
+
<div class="dm-camera-mn-resolution-option" data-width="640" data-height="480">480P</div>
|
|
136
|
+
<div class="dm-camera-mn-resolution-option" data-width="1080" data-height="720">720P</div>
|
|
137
|
+
<div class="dm-camera-mn-resolution-option" data-width="1920" data-height="1080">1080P</div>
|
|
138
|
+
<div class="dm-camera-mn-resolution-option" data-width="2560" data-height="1440">2K</div>
|
|
139
|
+
<div class="dm-camera-mn-resolution-option" data-width="3840" data-height="2160">4K</div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<svg class="dce-bg-loading"
|
|
143
|
+
style="display:none;position:absolute;left:0;top:0;right:0;bottom:0;margin:auto;width:40%;height:40%;fill:#aaa;animation:1s linear infinite dce-rotate;"
|
|
144
|
+
viewBox="0 0 1792 1792">
|
|
145
|
+
<path d="M1760 896q0 176-68.5 336t-184 275.5-275.5 184-336 68.5-336-68.5-275.5-184-184-275.5-68.5-336q0-213 97-398.5t265-305.5 374-151v228q-221 45-366.5 221t-145.5 406q0 130 51 248.5t136.5 204 204 136.5 248.5 51 248.5-51 204-136.5 136.5-204 51-248.5q0-230-145.5-406t-366.5-221v-228q206 31 374 151t265 305.5 97 398.5z" />
|
|
146
|
+
</svg>
|
|
147
|
+
<div class="dce-bg-camera" title="Take a photo" style="display:none;position:absolute;left:0;top:0;width:100%;height:100%;cursor:pointer;pointer-events:auto;">
|
|
148
|
+
<svg style="position:absolute;left:0;top:0;right:0;bottom:0;margin:auto;width:40%;height:40%;fill:#aaa;"
|
|
149
|
+
viewBox="0 0 2048 1792">
|
|
150
|
+
<path d="M1024 672q119 0 203.5 84.5t84.5 203.5-84.5 203.5-203.5 84.5-203.5-84.5-84.5-203.5 84.5-203.5 203.5-84.5zm704-416q106 0 181 75t75 181v896q0 106-75 181t-181 75h-1408q-106 0-181-75t-75-181v-896q0-106 75-181t181-75h224l51-136q19-49 69.5-84.5t103.5-35.5h512q53 0 103.5 35.5t69.5 84.5l51 136h224zm-704 1152q185 0 316.5-131.5t131.5-316.5-131.5-316.5-316.5-131.5-316.5 131.5-131.5 316.5 131.5 316.5 316.5 131.5z" />
|
|
151
|
+
</svg>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
<style>
|
|
155
|
+
@keyframes dce-rotate {
|
|
156
|
+
from { transform: rotate(0turn); }
|
|
157
|
+
to { transform: rotate(1turn); }
|
|
158
|
+
}
|
|
159
|
+
@keyframes dm-camera-scanlight {
|
|
160
|
+
from { top: 0; }
|
|
161
|
+
to { top: 97%; }
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.dm-camera-mn-torch-auto,.dm-camera-mn-torch-on,.dm-camera-mn-torch-off
|
|
165
|
+
{position:absolute;width:max(3vmin,24px);height:max(3vmin,24px);left:12px;top:12px;padding:max(0.5vmin,4px);box-sizing:border-box;border-radius:max(1.5vmin,12px);background:rgba(100,100,100,0.5);cursor:pointer;pointer-events:initial;}
|
|
166
|
+
|
|
167
|
+
.dm-camera-mn-beep-on,.dm-camera-mn-beep-off
|
|
168
|
+
{position:absolute;width:max(3vmin,24px);height:max(3vmin,24px);left:calc(48px + max(3vmin,24px));padding:max(0.5vmin,4px);box-sizing:border-box;top:12px;border-radius:max(1.5vmin,12px);background:rgba(100,100,100,0.5);cursor:pointer;pointer-events:initial;}
|
|
169
|
+
|
|
170
|
+
.dm-camera-mn-vibrate-on,.dm-camera-mn-vibrate-off
|
|
171
|
+
{position:absolute;width:max(3vmin,24px);height:max(3vmin,24px);left:calc(84px + max(6vmin,48px));padding:max(0.25vmin,2px);box-sizing:border-box;top:12px;border-radius:max(1.5vmin,12px);background:rgba(100,100,100,0.5);cursor:pointer;pointer-events:initial;}
|
|
172
|
+
|
|
173
|
+
.dm-camera-mn-resolution-box{position:absolute;width:max(5vmin,40px);right:12px;top:12px;font-size:max(1.25vmin,10px);line-height:max(2vmin,16px);padding:max(0.5vmin,4px);box-sizing:border-box;text-align:center;color:#fff;border-radius:max(0.75vmin,6px);background:rgba(100,100,100,0.5);display:block;cursor:pointer;pointer-events:initial;user-select:none;}
|
|
174
|
+
|
|
175
|
+
.dm-camera-mn-zoom{position:absolute;font-size:max(1vmin,8px);line-height:max(3vmin,24px);left:50%;bottom:max(12.5vmin,100px);transform:translateX(-50%);color:#fff;}
|
|
176
|
+
.dm-camera-mn-zoom span{width:max(3vmin,24px);border-radius:max(1.5vmin,12px);text-align:center;background:rgba(100,100,100,0.5);display:inline-block;}
|
|
177
|
+
.dm-camera-mn-toast{position:absolute;max-width:90%;font-size:max(1.25vmin,10px);line-height:max(2vmin,16px);padding:max(0.25vmin,2px) max(0.5vmin,4px);left:50%;bottom:max(12.5vmin,100px);transform:translateX(-50%);color:#fff;border-radius:max(0.5vmin,4px);background:rgba(100,100,100,0.5);white-space:pre-wrap;overflow-wrap:break-word;}
|
|
178
|
+
|
|
179
|
+
.dm-camera-mn-camera-close{position:absolute;width:max(4vmin,32px);height:max(4vmin,32px);left:16px;bottom:32px;padding:max(0.5vmin,4px);border-radius:max(2.5vmin,20px);background:rgba(100,100,100,0.5);cursor:pointer;pointer-events:initial;}
|
|
180
|
+
.dm-camera-mn-take-photo{position:absolute;width:max(7vmin,56px);height:max(7vmin,56px);border:max(0.5vmin,4px) solid #fff;left:50%;border-radius:max(3.5vmin,28px);box-sizing:border-box;bottom:max(4vmin,32px);transform:translateX(-50%);cursor:pointer;pointer-events:initial;}
|
|
181
|
+
.dm-camera-mn-camera-switch{position:absolute;width:max(4vmin,32px);height:max(4vmin,32px);right:16px;bottom:32px;padding:max(0.5vmin,4px);border-radius:max(2.5vmin,20px);background:rgba(100,100,100,0.5);cursor:pointer;pointer-events:initial;}
|
|
182
|
+
|
|
183
|
+
.dm-camera-mn-msg-poweredby{position:absolute;height:max(2.125vmin,17px);left:50%;bottom:4px;transform:translateX(-50%);fill:#fff;}
|
|
184
|
+
|
|
185
|
+
.dm-camera-mn-camera-and-resolution-settings{position:absolute;top:calc(24px + max(3vmin,24px));right:0;max-height:calc(100% - 24px - max(3vmin,24px));background:rgba(100,100,100,0.5);display:flex;pointer-events:initial;}
|
|
186
|
+
.dm-camera-mn-cameras{overflow-y:auto;display:block;}
|
|
187
|
+
.dm-camera-mn-camera-option{font-size:max(1.25vmin,10px);line-height:max(2vmin,16px);padding:max(0.5vmin,4px);margin:12px;box-sizing:border-box;position:relative;text-align:center;color:#fff;border-radius:max(0.75vmin,6px);background:rgba(100,100,100,0.5);display:block;cursor:pointer;}
|
|
188
|
+
.dm-camera-mn-camera-and-resolution-bar{width:1px;align-self:stretch;background:rgba(100,100,100,0.5);}
|
|
189
|
+
.dm-camera-mn-resolutions{overflow-y:auto;display:block;}
|
|
190
|
+
.dm-camera-mn-resolution-option{width:max(5vmin,40px);font-size:max(1.25vmin,10px);line-height:max(2vmin,16px);padding:max(0.5vmin,4px);margin:12px;box-sizing:border-box;position:relative;text-align:center;color:#fff;border-radius:max(0.75vmin,6px);background:rgba(100,100,100,0.5);display:block;cursor:pointer;}
|
|
191
|
+
.dm-camera-mn-camera-option[selected],.dm-camera-mn-resolution-option[selected]{box-shadow:inset 0 0 0 max(0.25vmin, 2px) rgb(254,142,20);}
|
|
192
|
+
|
|
193
|
+
.dm-camera-mn-torch-auto::before,.dm-camera-mn-torch-on::before,.dm-camera-mn-torch-off::before,
|
|
194
|
+
.dm-camera-mn-beep-on::before,.dm-camera-mn-beep-off::before,
|
|
195
|
+
.dm-camera-mn-vibrate-on::before,.dm-camera-mn-vibrate-off::before,
|
|
196
|
+
.dm-camera-mn-resolution-box::before,
|
|
197
|
+
.dm-camera-mn-camera-close::before,.dm-camera-mn-take-photo::before,.dm-camera-mn-camera-switch::before
|
|
198
|
+
{content:"";position:absolute;inset:-12px;width:calc(100% + 24px);height:calc(100% + 24px);}
|
|
199
|
+
.dm-camera-mn-camera-option::before,.dm-camera-mn-resolution-option::before
|
|
200
|
+
{content:"";position:absolute;inset:-12px;width:calc(100% + 24px);height:calc(100% + 24px);}
|
|
201
|
+
</style>
|
|
202
|
+
<script>
|
|
203
|
+
(()=>{ // wrapper to avoid conflicts when apply many times
|
|
204
|
+
const camera = document.currentScript.currentDMCamera;
|
|
205
|
+
const scanlight = document.createElement('div');
|
|
206
|
+
Object.assign(scanlight.style, {
|
|
207
|
+
position: 'absolute',
|
|
208
|
+
width: '100%',
|
|
209
|
+
height: '3%',
|
|
210
|
+
borderRadius: '50%',
|
|
211
|
+
boxShadow: '0px 0px 2vw 1px #00e5ff',
|
|
212
|
+
background: '#fff',
|
|
213
|
+
animation: '3s infinite dm-camera-scanlight',
|
|
214
|
+
pointerEvents: 'none',
|
|
215
|
+
userSelect: 'none',
|
|
216
|
+
display: 'none',
|
|
217
|
+
});
|
|
218
|
+
camera.setRegionBox({innerUi: scanlight});
|
|
219
|
+
|
|
220
|
+
const ui = camera.ui;
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
const elTorch = ui.querySelector('.dm-camera-mn-torch');
|
|
224
|
+
const elTorchAuto = ui.querySelector('.dm-camera-mn-torch-auto');
|
|
225
|
+
const elTorchOn = ui.querySelector('.dm-camera-mn-torch-on');
|
|
226
|
+
const elTorchOff = ui.querySelector('.dm-camera-mn-torch-off');
|
|
227
|
+
if(elTorchAuto){ elTorchAuto.style.display = undefined == camera.isTorchOn ? '' : 'none'; }
|
|
228
|
+
if(elTorchOn){ elTorchOn.style.display = true == camera.isTorchOn ? '' : 'none'; }
|
|
229
|
+
if(elTorchOff){ elTorchOff.style.display = false == camera.isTorchOn ? '' : 'none'; }
|
|
230
|
+
|
|
231
|
+
// beep and vibrate need work with dbrjs onFrameRead, we provide `beep()` in camera's `plugin-feedback.ts`
|
|
232
|
+
const elBeepOn = ui.querySelector('.dm-camera-mn-beep-on');
|
|
233
|
+
const elBeepOff = ui.querySelector('.dm-camera-mn-beep-off')
|
|
234
|
+
const elVibrateOn = ui.querySelector('.dm-camera-mn-vibrate-on');
|
|
235
|
+
const elVibrateOff = ui.querySelector('.dm-camera-mn-vibrate-off');
|
|
236
|
+
|
|
237
|
+
const elResolutionBox = ui.querySelector('.dm-camera-mn-resolution-box');
|
|
238
|
+
const elZoom = ui.querySelector('.dm-camera-mn-zoom');
|
|
239
|
+
let elZoomSpan;
|
|
240
|
+
if(elZoom){
|
|
241
|
+
elZoom.style.display = 'none';
|
|
242
|
+
elZoomSpan = elZoom.querySelector('span');
|
|
243
|
+
}
|
|
244
|
+
const elToast = ui.querySelector('.dm-camera-mn-toast');
|
|
245
|
+
const elCameraClose = ui.querySelector('.dm-camera-mn-camera-close');
|
|
246
|
+
const elTakePhoto = ui.querySelector('.dm-camera-mn-take-photo');
|
|
247
|
+
const elCameraSwitch = ui.querySelector('.dm-camera-mn-camera-switch');
|
|
248
|
+
const elCameraAndResolutionSettings = ui.querySelector('.dm-camera-mn-camera-and-resolution-settings');
|
|
249
|
+
if(elCameraAndResolutionSettings){ elCameraAndResolutionSettings.style.display = 'none'; }
|
|
250
|
+
const divCameras = elCameraAndResolutionSettings?.querySelector('.dm-camera-mn-cameras');
|
|
251
|
+
const arrElResolutionOption = elCameraAndResolutionSettings?.querySelectorAll('.dm-camera-mn-resolution-option');
|
|
252
|
+
|
|
253
|
+
camera.addEventListener('opened',async()=>{
|
|
254
|
+
if('customized-video' != camera.requestedCamera){
|
|
255
|
+
|
|
256
|
+
// mirror front camera
|
|
257
|
+
camera.isMirrored = camera.currentCamera?.isFront;
|
|
258
|
+
|
|
259
|
+
if(elTorch){ elTorch.style.display = ''; }
|
|
260
|
+
|
|
261
|
+
// show current resolution
|
|
262
|
+
if(elResolutionBox || arrElResolutionOption?.length){
|
|
263
|
+
let resolutionFriendlyName;
|
|
264
|
+
// Notice: rule should match names in the resolution options
|
|
265
|
+
{
|
|
266
|
+
let rsl = camera.currentResolution;
|
|
267
|
+
let x = Math.max(rsl.width, rsl.height);
|
|
268
|
+
let y = Math.min(rsl.width, rsl.height);
|
|
269
|
+
if(y <= 1080){
|
|
270
|
+
resolutionFriendlyName = y + 'P';
|
|
271
|
+
}else if(x < 3000){
|
|
272
|
+
resolutionFriendlyName = '2K'
|
|
273
|
+
}else{ // x >= 3000
|
|
274
|
+
resolutionFriendlyName = Math.round(x / 1000) + 'K';
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if(elResolutionBox){
|
|
279
|
+
elResolutionBox.textContent = resolutionFriendlyName;
|
|
280
|
+
elResolutionBox.style.display = '';
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if(arrElResolutionOption?.length){
|
|
284
|
+
for(let option of arrElResolutionOption){
|
|
285
|
+
if(option.textContent === resolutionFriendlyName){
|
|
286
|
+
option.setAttribute('selected', '');
|
|
287
|
+
}else if(option.hasAttribute('selected')){
|
|
288
|
+
option.removeAttribute('selected');
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// show current camera
|
|
295
|
+
if(divCameras){
|
|
296
|
+
const infos = await camera.constructor.getDeviceInfos();
|
|
297
|
+
const curCam = camera.currentCamera;
|
|
298
|
+
if(!curCam){ return; } // rarely, after await, camera may already change
|
|
299
|
+
const curCamLabel = curCam.trackLabel || curCam.label;
|
|
300
|
+
divCameras.textContent = '';
|
|
301
|
+
for (let info of infos) {
|
|
302
|
+
const opt = document.createElement("div");
|
|
303
|
+
opt.classList.add('dm-camera-mn-camera-option');
|
|
304
|
+
opt.setAttribute('data-device-id', info.deviceId);
|
|
305
|
+
opt.textContent = info.trackLabel || info.label;
|
|
306
|
+
if(opt.textContent === curCamLabel){
|
|
307
|
+
opt.setAttribute('selected', '');
|
|
308
|
+
}
|
|
309
|
+
divCameras.append(opt);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// show switch camera button
|
|
314
|
+
if(await camera.constructor.hasFrontCamera()){
|
|
315
|
+
if(elCameraSwitch){ elCameraSwitch.style.display = ''; }
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
camera.addEventListener('closed',()=>{
|
|
321
|
+
if(elTorch){ elTorch.style.display = 'none'; }
|
|
322
|
+
if(elResolutionBox){ elResolutionBox.style.display = 'none'; }
|
|
323
|
+
if(elCameraSwitch){ elCameraSwitch.style.display = 'none'; }
|
|
324
|
+
if(elCameraAndResolutionSettings){ elCameraAndResolutionSettings.style.display = 'none'; }
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
elTorchAuto?.addEventListener('pointerdown', ()=>{
|
|
328
|
+
camera.turnOnTorch();
|
|
329
|
+
elTorchAuto.style.display = 'none';
|
|
330
|
+
elTorchOn.style.display = '';
|
|
331
|
+
});
|
|
332
|
+
elTorchOn?.addEventListener('pointerdown', ()=>{
|
|
333
|
+
camera.turnOffTorch();
|
|
334
|
+
elTorchOn.style.display = 'none';
|
|
335
|
+
elTorchOff.style.display = '';
|
|
336
|
+
});
|
|
337
|
+
elTorchOff?.addEventListener('pointerdown', ()=>{
|
|
338
|
+
if(!camera.isSupportTorch){
|
|
339
|
+
funcShowToast('Torch Not Supported');
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
camera.turnAutoTorch();
|
|
343
|
+
elTorchOff.style.display = 'none';
|
|
344
|
+
elTorchAuto.style.display = '';
|
|
345
|
+
});
|
|
346
|
+
camera.addEventListener('torchAutoOn', ()=>{
|
|
347
|
+
funcShowToast('Torch Auto On');
|
|
348
|
+
if(elTorchAuto){elTorchAuto.style.display = 'none';}
|
|
349
|
+
if(elTorchOn){elTorchOn.style.display = '';}
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
ui.addEventListener('click', async(ev)=>{
|
|
353
|
+
let target = ev.target;
|
|
354
|
+
let option;
|
|
355
|
+
if(option = target.closest('.dm-camera-mn-camera-option')){
|
|
356
|
+
// change camera
|
|
357
|
+
if(option.hasAttribute('selected')){ return; }
|
|
358
|
+
await camera.requestCamera(option.getAttribute('data-device-id'));
|
|
359
|
+
// if remove usb camera, camera status can be 'paused'
|
|
360
|
+
// anyway, if not 'opened', reopen it
|
|
361
|
+
if('opened' !== camera.status){ await camera.open(); }
|
|
362
|
+
}else if(option = target.closest('.dm-camera-mn-resolution-option')){
|
|
363
|
+
// change resolution
|
|
364
|
+
if(option.hasAttribute('selected')){ return; }
|
|
365
|
+
let width = parseInt(option.getAttribute('data-width'));
|
|
366
|
+
let height = parseInt(option.getAttribute('data-height'));
|
|
367
|
+
await camera.requestResolution({ width, height });
|
|
368
|
+
|
|
369
|
+
if(arrElResolutionOption.length){
|
|
370
|
+
const selectedOption = elCameraAndResolutionSettings?.querySelector('.dm-camera-mn-resolution-option[selected]');
|
|
371
|
+
if(selectedOption && selectedOption.textContent != option.textContent){
|
|
372
|
+
funcShowToast(`Fallback to ${selectedOption.textContent}`);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}else if(target.closest('.dm-camera-mn-camera-and-resolution-settings')){
|
|
376
|
+
// nothing happen
|
|
377
|
+
return;
|
|
378
|
+
}else if(target.closest('.dm-camera-mn-resolution-box')){ // toggle settings
|
|
379
|
+
if(elCameraAndResolutionSettings){
|
|
380
|
+
elCameraAndResolutionSettings.style.display = elCameraAndResolutionSettings.style.display ? '' : 'none';
|
|
381
|
+
}
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
// hide settings
|
|
385
|
+
if(elCameraAndResolutionSettings){
|
|
386
|
+
if('' === elCameraAndResolutionSettings.style.display){
|
|
387
|
+
elCameraAndResolutionSettings.style.display = 'none';
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
let taskInfoZoomChange = null;
|
|
393
|
+
camera.addEventListener('zoom', ({zoom})=>{
|
|
394
|
+
if(!elZoom || !elZoomSpan){ return; }
|
|
395
|
+
elZoomSpan.textContent = zoom.toFixed(1);
|
|
396
|
+
elZoom.style.display = '';
|
|
397
|
+
if(null != taskInfoZoomChange){
|
|
398
|
+
clearTimeout(taskInfoZoomChange);
|
|
399
|
+
taskInfoZoomChange = null;
|
|
400
|
+
}
|
|
401
|
+
taskInfoZoomChange = setTimeout(()=>{
|
|
402
|
+
elZoom.style.display = 'none';
|
|
403
|
+
taskInfoZoomChange = null;
|
|
404
|
+
}, 3000);
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
let taskShowToast = null;
|
|
408
|
+
const funcShowToast = camera.funcShowToast = (info, duration = 3000)=>{
|
|
409
|
+
if(!elToast){ return; }
|
|
410
|
+
elToast.textContent = info;
|
|
411
|
+
elToast.style.display = '';
|
|
412
|
+
if(null != taskShowToast){
|
|
413
|
+
clearTimeout(taskShowToast);
|
|
414
|
+
taskShowToast = null;
|
|
415
|
+
}
|
|
416
|
+
if(duration){ // 0 never hide
|
|
417
|
+
taskShowToast = setTimeout(()=>{
|
|
418
|
+
elToast.style.display = 'none';
|
|
419
|
+
taskShowToast = null;
|
|
420
|
+
}, duration);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
elCameraClose?.addEventListener('click', ()=>{ camera.close(); });
|
|
425
|
+
|
|
426
|
+
elCameraSwitch?.addEventListener('pointerdown', async()=>{
|
|
427
|
+
await camera.requestCamera(camera.currentCamera.isFront ? 'back': 'front');
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
})();
|
|
431
|
+
</script>
|