Search code examples
google-chromevue.jsgetusermedia

"Media Stream API is not supported" mobile chrome when trying to scan barcodes from mobile[vue]


I am using this library that uses the getUserMedia() api to get a live stream of the current devices camera.

This works perfectly well on Chrome for desktop but on mobile it fails with:

---> <StreamBarcodeReader> at node_modules/vue-barcode-reader/src/components/StreamBarcodeReader.vue
       <ScanView> at src/views/ScanView.vue
         <App> at src/App.vue
           <Root>
ERRORException: Media Stream API is not supported

I checked on caniuse.com to see if its supported and it says it is. Maybe this is a different api im seeing?

What am I doing wrong here?

EDIT:

Here is a demo of exactly what I am trying to do. This work son Safari but not on Chrome


Solution

  • The demo works for me on Chrome on Android. On iOS, Chrome (and any non-Safari browser) probably (can't test it myself) doesn't have access to it - see https://bugs.chromium.org/p/chromium/issues/detail?id=752458