Can't open Samsung S20 Camera
See original GitHub issueDescribe the bug I’ve implemented this plugin in my Angular project succesfully, also I’ve been able to test in some smartphones and it’s working great, but in my Samsung S20 I’m not able to open the camera. I’ve tried to check what cameras the plugin finds and it seems that it does find the back cameras, and I’ve also tried to implement the solution described in other bugs raised here but they don’t seem to fix mine.
Here’s the code that I’ve implemented: `camerasFoundHandler(e) { this.availableDevices = e; this.hasDevices = Boolean(e && e.length); console.dir(e);
let backCams = this.availableDevices.filter((c) => c.label.includes('back'));
console.dir(backCams);
if (backCams.length > 0) {
this.currentDevice = backCams[0];
} else {
this.currentDevice = this.availableDevices[0];
}
setTimeout(() => {
this.enableScanner = true;
console.dir(this.currentDevice);
setTimeout(() => {
this.th = true; // This is to enable the tryHarder
}, 1000);
}, 1000);
}`
I’ve also tried to run through all the cameras trying to open one by one with the following function:
myLoop(devices){ setTimeout(() => { console.dir(devices[this.controller]); this.currentDevice = devices[this.controller]; this.controller++; if (this.controller < devices.length) { this.myLoop(devices); } }, 3000); }
but it throws an error that says “Uncaught (in promise): Error: No scanning is running at the time.” Expected behavior The camera should open
Smartphone (please complete the following information):
- Device: Samsung S20
- OS: Android 11
- Browser: Google Chrome latest version
Issue Analytics
- State:
- Created 2 years ago
- Comments:13
Top GitHub Comments
any updates on this guys?
I can also confirm that this is not working. I have gone through all the other issues raised and tried all the solutions presented and they haven’t worked. I am now in the process of testing the API itself. I have written this code (as a test)
And this works on my phone (s20)