Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: scanner breaks after constraint update #417

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

gruhn
Copy link
Owner

@gruhn gruhn commented Feb 7, 2024

Scanner does not work anymore after when deviceId via constraints is updated and no other props are changed. This is because:

==> both cameraActive.value and cameraSettings.shouldStream stay true
==> then shouldScan also does not change
==> therefore the watcher on shouldScan is not triggered
==> and finally we don't start a new scanning process

To prevent that, we now explicitly set cameraActive to false right before requesting a new camera. That is not just a hack but also makes semantically sense, because the camera is briefly inactive right before requesting a new camera.

See: #416

Scanner does not work anymore after when `deviceId` via `constraints` is updated
and no other props are changed. This is because:

  ==> both `cameraActive.value` and `cameraSettings.shouldStream` stay `true`
  ==> then `shouldScan` also does not change
  ==> therefore the watcher on `shouldScan` is not triggered
  ==> and finally we don't start a new scanning process

To prevent that, we now explicitly set `cameraActive` to `false` right before
requesting a new camera. That is not just a hack but also makes semantically sense,
because the camera is briefly inactive right before requesting a new camera.

See: #416
Copy link

netlify bot commented Feb 7, 2024

Deploy Preview for vue-qrcode-reader ready!

Name Link
🔨 Latest commit 5be49cf
🔍 Latest deploy log https://app.netlify.com/sites/vue-qrcode-reader/deploys/65c40799b443640008588e53
😎 Deploy Preview https://deploy-preview-417--vue-qrcode-reader.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@gruhn gruhn merged commit c879435 into master Feb 7, 2024
4 checks passed
@gruhn gruhn deleted the fix-scanner-breaks-on-device-id-update branch February 7, 2024 22:46
Copy link

github-actions bot commented Feb 7, 2024

🎉 This PR is included in version 5.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant