Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(barcode-scanning): mount camera to HTML tag OR set camera height/width #79

Open
1 of 3 tasks
mtpython opened this issue Sep 17, 2023 · 4 comments
Open
1 of 3 tasks

Comments

@mtpython
Copy link

mtpython commented Sep 17, 2023

Plugin(s)

  • Barcode Scanning
  • Face Detection
  • Translation

Current problem

Currently, the camera preview takes up the full background. It would be useful to either mount the camera preview into an HTLM tag with set dimensions, or set the width/height of the camera preview itself, allowing to frame it by overlaying UI over it.

Preferred solution

Two possible solutions:

  1. Add selector for an HTML tag as a parent, to which the camera preview is mounted, e.g. by id:
export interface StartScanOptions {
    formats?: BarcodeFormat[];
    lensFacing?: LensFacing;
+   parentID?: string;
}

Which would mount to HTML tag with id provided in parentID (= camera-parent):

<div id="camera-parent" style="height: 400px" />
  1. Add height / width (dimensions) property for the camera preview:
export interface StartScanOptions {
    formats?: BarcodeFormat[];
    lensFacing?: LensFacing;
+   dimensions?: Dimensions;
}

+ export interface Dimensions {
+    width?: string;
+    height?: string;
+ }

To allow making the preview smaller than full viewport width and height.

Alternative options

No response

Additional context

No response

@mtpython mtpython changed the title feat: mount camera to HTML tags OR set camera height/width feat: mount camera to HTML tag OR set camera height/width Sep 17, 2023
@robingenz
Copy link
Member

Thank you for your request!

It would be useful to either mount the camera preview into an HTLM tag

This is the ultimate goal. I have other priorities at the moment, but PRs are welcome.

or set the width/height of the camera preview itself, allowing to frame it by overlaying UI over it.

You can already put custom WebView UI over the camera view. So defining a certain width/height would only have performance advantages.

@robingenz robingenz changed the title feat: mount camera to HTML tag OR set camera height/width feat(barcode-scanning): mount camera to HTML tag OR set camera height/width Dec 8, 2023
@C-AAEN
Copy link

C-AAEN commented Feb 5, 2024

@robingenz Hello. Is there an estimate on when this feature is implemented. I'm in search for a barcode scanner for Ionic Vue where it does not take up the entire screen. As mtpython says if it could be an HTML tag that is more controllable and I can have other tags visiable together with the camera open that would be superb

@robingenz
Copy link
Member

Is there an estimate on when this feature is implemented?

No, there is no ETA.

and I can have other tags visiable together with the camera open that would be superb

You can already have other html elements visible when the camera is active. That's what we implemented in our official demo app. You just need to set the correct css rules.

@xulihang

This comment was marked as off-topic.

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

No branches or pull requests

4 participants