Comments (5)
Thanks for reporting. However, currently chrome also doesn't seem to support any different API (e.g. it doesn't support facingMode
in mediaDevices.getUserMedia
and it doesn't have a full implementation of the new mediaDevices.getUserMedia). Considering these circumstances, I don't think I can update just yet, I have to keep using the deprecated API.
I uploaded my experimental changes to the update_mediadevices
branch. It works fine in firefox for me, but doesn't properly select the back camera on chrome on android (which is just what the code is supposed to do).
from qrscanjs.
Hi @Jeija I am using QRScan in my PWA application. https://qrcodescan.in.
navigator.mediaDevices.enumerateDevices()
is working fine in firefox, chrome, opera.
from qrscanjs.
There still is the problem of camera selection on mobile devices though. Chrome on Android still doesn't support the facingMode
constraint, which is what we need to tell Chrome to use the rear, environment-facing camera (similar to what the W3C specification says in https://w3c.github.io/mediacapture-main/getusermedia.html#interface-definition, Example 9).
If I understand the code for https://qrcodescan.in correctly, you always assume that the second camera listed by navigator.mediaDevices.enumerateDevices()
is the environment-facing camera. That may work in most cases, but it doesn't cover all devices. Even webrtc-adapter hasn't solved this issue completely, they also need to fall back to using the last camera in the list (see https://github.com/webrtc/adapter/blob/master/src/js/chrome/getusermedia.js).
This means I can only remove MediaStreamTrack.getSources()
without loosing functionality when https://bugs.chromium.org/p/chromium/issues/detail?id=290161 is resolved. Otherwise, I'd much rather use a deprecated API than dropping functionality.
As soon as the Chromium bug is resolved and clients are updated, I will upgrade to the code on the https://github.com/Jeija/QRScanJS/tree/update_mediadevices branch and switch to the new API.
from qrscanjs.
It seems like the "deprecated" status has finally turned into removed and the example no longer works on Chrome, with a console error saying that MediaStreamTrack is not a function. @gokulkrishh perhaps you could make a pull request with the way that worked in your PWA?
from qrscanjs.
@abagh0703 Sure. let me see what i can do.
from qrscanjs.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qrscanjs.