How to access the iPhone's camera from Mobile Safari

前端 未结 3 602
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 07:39

Is there a API or way for accessing the the iPhone\'s camera from Mobile Safari?I want to create a application that can read barcode within the browser. Thanks in advance.

相关标签:
3条回答
  • 2020-12-30 07:56

    It's now supported in iOS 6. I believe it uses a regular form file input field.

    You can see some explanation here.

    0 讨论(0)
  • 2020-12-30 08:03

    Try using input tag <input type="file" name="image" accept="image/*" capture/>.

    It works well as compared to getUserMedia method which is fully supported by Opera mobile and chrome higher versions. Hope it help.

    0 讨论(0)
  • 2020-12-30 08:06

    No. There's no way to do that. No web page can access internal devices.

    You can do however a small tiny app that its launched via mobile safari link and makes user select the barcode image and then redirect to a web page that will process (the small app will also upload). Like what THIS guys actually implemented (the link provides code).

    If you doesn't have experience with Objective C and Cocoa Touch you can create that app via PhoneGap like if you were creating a Web Page.

    UPDATE

    From iOS 6 and so on you actually can as the official specs says, you can use it via the upload API as seen here.

    0 讨论(0)
提交回复
热议问题