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

Using camera feature in mobile responsive way is not working #232

Open
chetna-webonise opened this issue Jun 9, 2020 · 6 comments
Open
Assignees
Labels
up for grabs Feel free to pick this up in a PR!

Comments

@chetna-webonise
Copy link

I have integrated uppload plugin in the React webosite ,it works fine for all the types of services including camera.
But when I try to upload image using camera option in mobile for the same site, the camera option does not shows up.

@AnandChowdhary AnandChowdhary self-assigned this Jun 9, 2020
@AnandChowdhary
Copy link
Contributor

Yes, based on whether the mobile device supports using Camera, the camera option may not appear. Chances are you're using iOS?

This is the supports expression (https://github.com/elninotech/uppload/blob/master/src/services/camera.ts#L20):

const supports = !!(
      window.navigator.mediaDevices &&
      window.navigator.mediaDevices.enumerateDevices &&
      !/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
    );

@AnandChowdhary
Copy link
Contributor

It seems like it's hardcoded to make sure mobile devices don't show the camera option, probably because of the formerly poor support of window.navigator.mediaDevices. I'll make sure I do some testing and remove that last condition.

@AnandChowdhary
Copy link
Contributor

However, most mobile devices support clicking a photo from the camera using the Local (file upload) service.

@chetna-webonise
Copy link
Author

Thanks for your quick response @AnandChowdhary

@chetna-webonise
Copy link
Author

My webiste uses uppload plugin for editing profile pictures. The feature i m working on has to be compatible with both web and mobile view,However for webiste it works fantastic, but when we switch to mobile the camera option disappears.
I don't want to add any other overhead on the code by writing extra functionality for mobile device to use camera and then take picture and upload.
Since your plugin does too good by giving all edit options..

Hope to listen from you soon on this.

@chetna-webonise
Copy link
Author

chetna-webonise commented Jun 10, 2020

However, most mobile devices support clicking a photo from the camera using the Local (file upload) service.

Yes it does.
Is the drop files here and select file button text customisable , there we can add both options like take a photo or select a file fro mobile view , so the user does not get confused.

@AnandChowdhary AnandChowdhary added the up for grabs Feel free to pick this up in a PR! label Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up for grabs Feel free to pick this up in a PR!
Development

No branches or pull requests

2 participants