Skip to content

Commit 7e2460f

Browse files
committed
Throw error for iOS Chrome #45
1 parent b3e1cd6 commit 7e2460f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ module.exports = class Reader extends Component {
132132
// Check browser facingMode constraint support
133133
// Firefox ignores facingMode or deviceId constraints
134134
const isFirefox = /firefox/i.test(navigator.userAgent)
135-
const supportedConstraints = navigator.mediaDevices.getSupportedConstraints()
135+
const supportedConstraints = navigator.mediaDevices !== undefined
136+
? navigator.mediaDevices.getSupportedConstraints()
137+
: {}
136138
const supportsFacingMode = supportedConstraints.facingMode
137139

138140
const vConstraintsPromise = isFirefox

0 commit comments

Comments
 (0)