最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Alternative to getUserMedia() for reading live camera stream on iOS? - Stack Overflow

programmeradmin6浏览0评论

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?

/

HTML5: getUserMedia iOS issue?

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?

Share Improve this question edited May 23, 2017 at 11:33 CommunityBot 11 silver badge asked Jan 12, 2017 at 17:37 Brian MansfieldBrian Mansfield 3702 gold badges5 silver badges18 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 14

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.

The quaggaJS page has a feature compatibility matrix which answers your question:

getusermedia is not supported on iOS safari.

As per the quaggaJS documentation (https://github.com/serratus/quaggaJS#browser-support)

Quagga makes use of many modern Web-APIs which are not implemented by all browsers yet. There are two modes in which Quagga operates:

  1. analyzing static images and

  2. using a camera to decode the images from a live-stream. The latter requires the presence of the MediaDevices API. You can track the compatibility of the used Web-APIs for each mode:

    • Static Images
    • Live Stream

I would suggest that you use static image mode on iOS as live stream mode is not supported.

发布评论

评论列表(0)

  1. 暂无评论