@@ -48,9 +48,9 @@ <h2>Scan or enter a barcode to search for product data</h2>
4848 <!-- Always-visible camera view -->
4949 < div id ="barcode-scanner-view ">
5050 <!-- Transparent overlay covering the full view; center click toggles play/pause -->
51- < div id ="camera-toggle-area " class ="loading " role =" button " tabindex =" 0 " aria-label =" Loading... ">
51+ < div id ="camera-toggle-area " class ="loading " aria-hidden =" true ">
5252 < div id ="loading-spinner "> </ div >
53- < div id ="play-pause-icon "> </ div >
53+ < div id ="play-pause-icon " role =" button " tabindex =" 0 " aria-label =" Toggle scanning " > </ div >
5454 </ div >
5555 </ div >
5656
@@ -166,6 +166,7 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
166166 const inputBox = document . getElementById ( "text-input" ) ;
167167 const barcodeScannerView = document . getElementById ( "barcode-scanner-view" ) ;
168168 const cameraToggleArea = document . getElementById ( "camera-toggle-area" ) ;
169+ const playPauseIcon = document . getElementById ( "play-pause-icon" ) ;
169170 const searchResult = document . getElementById ( "search-result" ) ;
170171 const filterToggleBtn = document . getElementById ( "filter-toggle-btn" ) ;
171172 const filtersPanel = document . getElementById ( "filters-panel" ) ;
@@ -382,16 +383,18 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
382383 function updateToggleUI ( ) {
383384 cameraToggleArea . classList . remove ( "loading" , "paused" ) ;
384385 if ( ! isCapturing ) cameraToggleArea . classList . add ( "paused" ) ;
385- cameraToggleArea . setAttribute ( "aria-label" , isCapturing ? "Pause scanning" : "Resume scanning" ) ;
386+ cameraToggleArea . setAttribute ( "aria-label" , isCapturing ? "Pause scanning" : "Resume scanning" ) ;
386387 }
387388
388389 async function toggleCapturing ( ) {
389390 if ( ! scanner || cameraToggleArea . classList . contains ( "loading" ) ) return ;
390391 if ( isCapturing ) {
391392 scanner . cvRouter . stopCapturing ( ) ;
393+ scanner . cameraEnhancer . pause ( ) ;
392394 isCapturing = false ;
393395 } else {
394396 await applySDKFilters ( ) ;
397+ await scanner . cameraEnhancer . resume ( ) ;
395398 await scanner . cvRouter . startCapturing ( "ReadSingleBarcode" ) ;
396399 isCapturing = true ;
397400 }
@@ -432,6 +435,7 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
432435 inputBox . value = item . text ;
433436 // Pause scanning after a successful read so the user can review the result
434437 cvRouter . stopCapturing ( ) ;
438+ cameraEnhancer . pause ( ) ;
435439 isCapturing = false ;
436440 updateToggleUI ( ) ;
437441 } ;
@@ -450,8 +454,8 @@ <h3 class="filter-section-title">Keyword Rules <span class="filter-hint">(all mu
450454 } ) ( ) ;
451455
452456 // ── Event listeners ────────────────────────────────────────────────────────
453- cameraToggleArea . addEventListener ( "click" , toggleCapturing ) ;
454- cameraToggleArea . addEventListener ( "keydown" , e => {
457+ playPauseIcon . addEventListener ( "click" , toggleCapturing ) ;
458+ playPauseIcon . addEventListener ( "keydown" , e => {
455459 if ( e . key === "Enter" || e . key === " " ) { e . preventDefault ( ) ; toggleCapturing ( ) ; }
456460 } ) ;
457461
0 commit comments