Skip to content

Commit

Permalink
Fix bug with Firefox browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Eckel committed Nov 3, 2023
1 parent 8dc114e commit 5e31def
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teckel/vue-barcode-reader",
"version": "1.1.4",
"version": "1.1.5",
"description": "Vue barcode and QR code scanner",
"main": "src/index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/components/StreamBarcodeReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ export default {
await navigator.mediaDevices.getUserMedia(constraints)
.then(stream => {
const track = stream.getVideoTracks()[0]
const trackCapabilities = track.getCapabilities()
const trackCapabilities = {
deviceId: cameras[index].deviceId,
...track.getCapabilities?.() ?? {}
}
deviceOptions.push(trackCapabilities)
stream.getTracks().forEach(track => { track.stop() })
return true
Expand Down

0 comments on commit 5e31def

Please sign in to comment.