0

I have a mobile website, and I thought it would be cool if there were a way for the user to take a picture with their phones camera to populate the field rather than have them go and upload a picture they have on their phone, similarly to the way used from some websites to access the computer's webcam to let you take pictures.

I'm not sure if this is even possible to do from within a web browser on a phone. I've seen Flash soultions that access the webcam of a computer via the browser, would any of those solutions work for Drupal?

3
  • Other phones may allows this, but it is unfortunately not possible with the iPhone and Mobile Safari. May 24, 2012 at 13:56
  • Being able to access the camera is a Phone/Javascript/Browser specific issue. This is only a Drupal question once a way of accessing the phone has been accessed.
    – Letharion
    May 24, 2012 at 14:01
  • 1
    @Letharion Remember you can vote to close questions that you don't think related to Drupal. To me the question is related to Drupal, as a module would be required to achieve this. The module should shown, for example, a flash widget that interacts with the webcam, and then send the image to a specific URL.
    – apaderno
    Jul 11, 2012 at 10:36

3 Answers 3

2

Agreed this is not purely a Drupal question but not unrelated, a little searching got me a really good answer on HTML5 Rocks taking you through the history and methods.

Specifically go to the section on getUserMedia(), there are even examples on the page that let you test it on your browser.

To my knowledge and from my searching I have not seen any Drupal module making use of this, but there is a discussion thread on drupal.org looking into this.

2

It's possible - I just did it! I used this sandbox module https://www.drupal.org/sandbox/cafuego/1980210 and Drupal core's image selector (didn't work with Media browser) and was able to:

  1. click the button to add a file - and my phone gave me three options, one being to take a new photo
  2. take the picture with my phone's camera
  3. upload it and save.

It worked!

Using a new Samsung Galaxy Note 4 and whatever version of Android came installed on it.

1

I think this is only possible via native applications. Only then you can request for permission to use camera. Although PhoneGap might be solution for this, I would not recommend it, and user will still have to download the application first.

3
  • Agreed. There are apps that facilitate uploading files to the web, but they are external to the phone's browser and it requires user to download them. Some phone browsers might actually work just fine with this, but it would be few and far between, and definitely not iPhone unless you require users to use an external app. May 24, 2012 at 13:58
  • Agreed. This is not possible with web applications. Phonegap would definitively be a solution, but then you would be required to built a hybrid app and use the drupal as a backend.
    – Mike
    Jul 11, 2012 at 11:46
  • I downvoted it, because, it seems false, and Duncanmoo's answers strongly suggests it was already false in 2012.
    – Mołot
    Aug 4, 2015 at 11:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.