Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

<input capture="camera"> on mobile #67

Open
abrichr opened this issue Oct 30, 2020 · 5 comments
Open

<input capture="camera"> on mobile #67

abrichr opened this issue Oct 30, 2020 · 5 comments

Comments

@abrichr
Copy link

abrichr commented Oct 30, 2020

I am currently considering whether to use vue-web-cam or <input type="file" accept="image/*" capture="camera">. This is for a mobile camera application. What are the tradeoffs of both of these approaches?

I'll start:

vue-web-cam:

Pros

  • Works on desktop and mobile
  • Customizable camera interface

Cons

  • Requires https on mobile

<input capture="camera">:

Pros

  • Built-in zoom / flash / face detection
  • Improved performance (shorter delay between pressing shutter button and seeing resulting image)

Cons

  • Less control (e.g. iOS forces the user to "retake" or "use photo" after every shutter button)
  • Mobile only

Would it be worth considering whether to use <input capture="camera"> in vue-web-cam when it's available?

@VinceG
Copy link
Owner

VinceG commented Oct 31, 2020

@abrichr Having this component handle this under the hood on mobile seems like it something that'll require some serious changes.

the API seems to be not compatible with anything else other than mobile devices
https://caniuse.com/html-media-capture

the only con. is that it requires https on mobile, with the tools we have today for the most part it's not an issue iMHO

@abrichr
Copy link
Author

abrichr commented Oct 31, 2020

Thanks for the quick reply!

Regarding implementation, an adapter pattern might be helpful.

Regarding getting it working on https, this can be a somewhat non-trivial (e.g. see fastapi/full-stack-fastapi-template#302 (comment)).

There are additional cons as well. Here is the combined list:

  • Requires https on mobile
  • Slower (longer delay between pressing shutter button and seeing resulting image)
  • User needs to allow permission to record video every time they refresh the page
  • No access to built-in zoom / flash / face detection
  • Requires additional effort to create functional camera UI (e.g. shutter button)

Regarding this:

with the tools we have today for the most part it's not an issue iMHO

Can you please clarify which tools you are referring to?

@VinceG
Copy link
Owner

VinceG commented Oct 31, 2020 via email

@TheGreatRefrigerator
Copy link

Hi @VinceG,
i'm sorry this has nothing to do with the topic, but i'm just wondering if the collapsible 3 dots block in your previous comment were added automatically by github, when you answered by mail?
This is a feature many people would love to use in their comment.. currently there is only the <details>...</details> workaround...
see e.g. here

It would be great if there is a way to do this on purpose

@VinceG
Copy link
Owner

VinceG commented Nov 1, 2020

@TheGreatRefrigerator yeah it was added automatically

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

No branches or pull requests

3 participants