Skip to content

Commit

Permalink
fix: "Invalid contraint" error on iOS
Browse files Browse the repository at this point in the history
iOS Safari seems to only accept specific resolution options as
constaints for `getUserMedia`. Even when declared with `ideal`.
Differing values cause an `OverconstraintError`. 640x480 seems to work.

See #39
  • Loading branch information
gruhn committed Jun 20, 2018
1 parent 934df3b commit c058df3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ This component uses [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/
audio: false, // don't request microphone access
video: {
facingMode: { ideal: 'environment' }, // use rear camera if available
width: { min: 360, ideal: 1280, max: 1920 }, // constrain video width resolution
height: { min: 240, ideal: 720, max: 1080 } // constrain video height resolution
width: { min: 360, ideal: 680, max: 1920 }, // constrain video width resolution
height: { min: 240, ideal: 480, max: 1080 }, // constrain video height resolution
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/components/QrcodeReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default {
} else {
withDefaults = {
facingMode: { ideal: 'environment' },
width: { min: 360, ideal: 680, max: 1920 },
width: { min: 360, ideal: 640, max: 1920 },
height: { min: 240, ideal: 480, max: 1080 },
...this.videoConstraints,
Expand Down

0 comments on commit c058df3

Please sign in to comment.