Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to getUserMedia() for reading live camera stream on iOS?

We are building a mobile barcode-scanner using QuaggaJS that reads barcodes directly from the device's camera stream. Works fine on desktop/Android, but doesn't work at all on iOS.

From initial research, I've found that iOS simply does not support WebRTC/getUserMedia through Safari or iOS Chrome (related links below), which is what QuaggaJS uses to read the camera stream.

I've also seen this question about capturing a still image on iOS, but the answer provided is only for capturing a still image, not for reading the stream real-time.

My question - is there any other way to grab the stream from an iOS camera? Perhaps an alternate library other than QuaggaJS that does not use getUserMedia? I am not well-versed in Javascript, so I am not sure if there even is a possible way to access the camera stream other than getUserMedia.

A "no" is an acceptable answer here; I'm simply looking for someone more experienced to provide guidance.


Appendix/related links:

navigator.getUserMedia alternative API for iOS safari mobile browser?

https://www.quora.com/Why-is-navigator-getUserMedia-not-supported-in-Safari

https://bloggeek.me/webrtc-apple-or-microsoft/

HTML5: getUserMedia iOS issue?

like image 425
Brian Mansfield Avatar asked Jan 12 '17 17:01

Brian Mansfield


People also ask

Does getUserMedia work on iOS?

getUserMedia() works properly on recent version of iOS. Generally 11.1 and beyond are OK. To troubleshoot this stuff, you need to connect your iOS device to a Mac and use the Safari remote debugging setup. That way you can get a console and javascript debugger.

What is navigator MediaDevices?

The Navigator. mediaDevices read-only property returns a MediaDevices object, which provides access to connected media input devices like cameras and microphones, as well as screen sharing.


1 Answers

2017 update: Apple just announced that getUserMedia will finally be supported in iOS11.

Aug 2019 update: ONLY works in Safari, not in a WebView of any kind. Thanks @Klathmon for the comment.

like image 141
wildpeaks Avatar answered Oct 12 '22 21:10

wildpeaks