@@ -19,9 +19,9 @@ <h2>Scan or enter a barcode to search for product data</h2>
1919 <!-- Always-visible camera view -->
2020 < div id ="barcode-scanner-view ">
2121 <!-- Transparent overlay covering the full view; center click toggles play/pause -->
22- < div id ="camera-toggle-area " class ="loading " role =" button " tabindex =" 0 " aria-label =" Loading... ">
22+ < div id ="camera-toggle-area " class ="loading " aria-hidden =" true ">
2323 < div id ="loading-spinner "> </ div >
24- < div id ="play-pause-icon "> </ div >
24+ < div id ="play-pause-icon " role =" button " tabindex =" 0 " aria-label =" Toggle scanning " > </ div >
2525 </ div >
2626 </ div >
2727
@@ -137,6 +137,7 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
137137 const inputBox = document . getElementById ( "text-input" ) ;
138138 const barcodeScannerView = document . getElementById ( "barcode-scanner-view" ) ;
139139 const cameraToggleArea = document . getElementById ( "camera-toggle-area" ) ;
140+ const playPauseIcon = document . getElementById ( "play-pause-icon" ) ;
140141 const searchResult = document . getElementById ( "search-result" ) ;
141142 const filterToggleBtn = document . getElementById ( "filter-toggle-btn" ) ;
142143 const filtersPanel = document . getElementById ( "filters-panel" ) ;
@@ -353,16 +354,18 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
353354 function updateToggleUI ( ) {
354355 cameraToggleArea . classList . remove ( "loading" , "paused" ) ;
355356 if ( ! isCapturing ) cameraToggleArea . classList . add ( "paused" ) ;
356- cameraToggleArea . setAttribute ( "aria-label" , isCapturing ? "Pause scanning" : "Resume scanning" ) ;
357+ cameraToggleArea . setAttribute ( "aria-label" , isCapturing ? "Pause scanning" : "Resume scanning" ) ;
357358 }
358359
359360 async function toggleCapturing ( ) {
360361 if ( ! scanner || cameraToggleArea . classList . contains ( "loading" ) ) return ;
361362 if ( isCapturing ) {
362363 scanner . cvRouter . stopCapturing ( ) ;
364+ scanner . cameraEnhancer . pause ( ) ;
363365 isCapturing = false ;
364366 } else {
365367 await applySDKFilters ( ) ;
368+ await scanner . cameraEnhancer . resume ( ) ;
366369 await scanner . cvRouter . startCapturing ( "ReadSingleBarcode" ) ;
367370 isCapturing = true ;
368371 }
@@ -403,6 +406,7 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
403406 inputBox . value = item . text ;
404407 // Pause scanning after a successful read so the user can review the result
405408 cvRouter . stopCapturing ( ) ;
409+ cameraEnhancer . pause ( ) ;
406410 isCapturing = false ;
407411 updateToggleUI ( ) ;
408412 } ;
@@ -421,8 +425,8 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
421425 } ) ( ) ;
422426
423427 // ── Event listeners ────────────────────────────────────────────────────────
424- cameraToggleArea . addEventListener ( "click" , toggleCapturing ) ;
425- cameraToggleArea . addEventListener ( "keydown" , e => {
428+ playPauseIcon . addEventListener ( "click" , toggleCapturing ) ;
429+ playPauseIcon . addEventListener ( "keydown" , e => {
426430 if ( e . key === "Enter" || e . key === " " ) { e . preventDefault ( ) ; toggleCapturing ( ) ; }
427431 } ) ;
428432
0 commit comments