Avoid setting a device during auto-start.
See original GitHub issueDescribe the bug When using the camera, I get an error saying: ‘Avoid setting a device during auto-start.’
To Reproduce Steps to reproduce the behavior:
- Open a page using the camera and the <zxing-scanner> tag.
Expected behavior The feedback of the camera should appear
Desktop (please complete the following information):
- OS: MacOs Cataline 10.15.5
- Browser Chrome
- Version 84.0.4147.135
Additional context According to source code, we are setting the device during auto start:
private autostartScanner(devices: MediaDeviceInfo[]) {
const matcher = ({ label }) => /back|trás|rear|traseira|environment|ambiente/gi.test(label);
// select the rear camera by default, otherwise take the last camera.
const device = devices.find(matcher) || devices.pop();
if (!device) {
throw new Error('Impossible to autostart, no input devices available.');
}
this.device = device; // HERE!
// @note when listening to this change, callback code will sometimes run before the previous line.
this.deviceChange.emit(device);
this.isAutostarting = false;
this.autostarted.next();
}
IMPORTANT: This might help you debug my issue: I had ^3.0.0 as a package dependency. while facing the issue I was on v 3.0.1 with your latest commit. Fixing version to 3.0.0 solved my issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Prevent programs from starting automatically in Windows - IU KB
Some startup items have no shortcut in the Startup folder. You can disable these with either the Startup apps/tasks tool in Settings or...
Read more >How to Enable and Disable Android Auto-start App in Android ...
Method 1: Turning off the doze feature · Go to settings and then Battery. · On the upper right-hand corner, tap on three...
Read more >Basic Computer Skills: Disable Applications from Running on ...
Disabling certain applications on startup is possible. Learn how to disable apps on startup in this free lesson.
Read more >Device Manager automatically opens on startup
NOTE: to do this, you must be logged in as an Admin user. A standard user does not have the necessary privileges to...
Read more >How to Stop Windows Apps From Launching at Startup - PCMag
Disable Startup Apps in Windows Settings ... Go to Settings > Apps > Startup to view a list of all apps that can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve got this working via
html:
and in the ts code
If you set the
autostart="false"
how do you start once you have set the device? All I get is this warning:Feature ‘autostart’ disabled. Permissions and devices recovery has to be run manually.
The permissions have been requested and accepted, what is devices recorvery?