Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5874

Barcodescanner doesn't work after detach and attach

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None
    • mobile ios

    • None

      Steps to Reproduce

      run https://zkfiddle.org/sample/3q7t634/9-Barcode-scanner in ios mobile (ios ver 18+)
      Click "detach" then "attach"

      Current Result

      black view

      Expected Result

      able to scan

      Workaround

      https://zkfiddle.org/sample/3kqs4ml/1-ZK-5874
      zk-5874.js
      The patch also works for ZK-5230

      Workaround 2

      1st part in the zul stopping the video on close (closing without scanning):

      <window id=\"barcodescannerWindow\" xmlns:w=\"client\" w:onClose=\"console.log('close video (on close in zul)');navigator.mediaDevices.getUserMedia({audio:false,video:{'facingMode': {'excat': 'environment'}}}).then(stream => {stream.getVideoTracks()[0].stop();console.log('done close in zul');});\">
      

      2nd part in java ondetect (when scanned):

      Clients.evalJavaScript("console.log('close video (on detect)');navigator.mediaDevices.getUserMedia({audio:false,video:{\"facingMode\": {\"excat\": \"environment\"}}}).then(stream => {stream.getVideoTracks()[0].stop();console.log('done detect');})");
      

            Unassigned Unassigned
            DevChu DevChu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: