Skip to content

feat(barcode-scanning): pause and resume scan feature, cap 7#300

Open
bakai-dev-team wants to merge 12 commits into
capawesome-team:mainfrom
bakai-dev-team:main
Open

feat(barcode-scanning): pause and resume scan feature, cap 7#300
bakai-dev-team wants to merge 12 commits into
capawesome-team:mainfrom
bakai-dev-team:main

Conversation

@bakai-dev-team

Copy link
Copy Markdown

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

@matthiasschwarz

Copy link
Copy Markdown

Is this pull request related to #298?
If this is the case, this implementation would, at least for Android and the web, only pause and resume the barcode scan, but not freeze the camera preview.

@bakai-dev-team

Copy link
Copy Markdown
Author

Is this pull request related to #298? If this is the case, this implementation would, at least for Android and the web, only pause and resume the barcode scan, but not freeze the camera preview.

Partially it resolves #298 too. We didn't test web version.

On Android

if pauseScan called it will skip all scanned results (will not resolve call) until resumeScan called

public void analyze(@NonNull ImageProxy imageProxy) {
        if (isPaused) {
            imageProxy.close();
            return;
        }
        ....
}

On iOS

It fill stop capture session (freeze) until resumeScan called

DispatchQueue.main.async {
          if let session = self.cameraView?.getCaptureSession() {
              if session.isRunning {
                  session.stopRunning()
              }
          }
}

@bakai-dev-team bakai-dev-team changed the title FEAT: Pause and Resume Scan on CAP 7 feat(barcode-scanning): pause and resume scan feature, cap 7 Sep 9, 2025
@robingenz

robingenz commented Sep 9, 2025

Copy link
Copy Markdown
Member

@bakai-dev-team It should freeze the camera view. Otherwise, this feature is useless since you can do the same in the webview (just remove the listener).

@bakai-dev-team

Copy link
Copy Markdown
Author

@bakai-dev-team It should freeze the camera view. Otherwise, this feature is useless since you can do the same in the webview (just remove the listener).

On IOS it's already behaves as you mentioned.

How can we do the same on Android?

@robingenz

Copy link
Copy Markdown
Member

@bakai-dev-team I haven't looked into it yet. It's part of the issue to find that out.

@bakai-dev-team

Copy link
Copy Markdown
Author

@robingenz All done as you required.

Anyone who can check and confirm that it is works, you are welcome.

@erlanz

erlanz commented Nov 5, 2025

Copy link
Copy Markdown

@robingenz HI, could you please check PR, thanks

@robingenz

Copy link
Copy Markdown
Member

PR is still failing.

@erlanz

erlanz commented Dec 6, 2025

Copy link
Copy Markdown

@robingenz Hello, fix lint, prettier. could you please check PR, thanks

@pkg-pr-new

pkg-pr-new Bot commented Dec 6, 2025

Copy link
Copy Markdown

Open in StackBlitz

@capacitor-mlkit/barcode-scanning

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/barcode-scanning@300

@capacitor-mlkit/document-scanner

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/document-scanner@300

@capacitor-mlkit/face-detection

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/face-detection@300

@capacitor-mlkit/face-mesh-detection

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/face-mesh-detection@300

@capacitor-mlkit/selfie-segmentation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/selfie-segmentation@300

@capacitor-mlkit/subject-segmentation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/subject-segmentation@300

@capacitor-mlkit/translation

npm i https://pkg.pr.new/capawesome-team/capacitor-mlkit/@capacitor-mlkit/translation@300

commit: aa3b0a0

@erlanz

erlanz commented Dec 10, 2025

Copy link
Copy Markdown

@robingenz Hello, fix lint, prettier. could you please check PR, thanks

@robingenz robingenz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested your implementation on all platforms?

Comment thread packages/barcode-scanning/src/definitions.ts Outdated
Comment thread packages/barcode-scanning/src/definitions.ts Outdated
Comment thread packages/barcode-scanning/src/web.ts
Comment thread packages/barcode-scanning/src/definitions.ts Outdated
Comment thread packages/barcode-scanning/src/definitions.ts Outdated
Comment thread packages/barcode-scanning/tsconfig.json Outdated
Comment thread packages/barcode-scanning/src/web.ts Outdated
Comment thread packages/barcode-scanning/src/web.ts
@konradliebig

Copy link
Copy Markdown

What is still missing in this PR? This would be an awesome feature to have.

@robingenz robingenz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the merge conflicts.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert those changes.

Comment thread package-lock.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert those changes.

@konradliebig

Copy link
Copy Markdown

@erlanz This branch still has merge conflicts. Also why did you add the patch-package script, even though no package is patched? And dist should also not be part of the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants