Skip to content

Commit 1137b42

Browse files
authored
v1.8.0
1 parent b611196 commit 1137b42

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@angular/platform-browser": "^16.1.0",
1919
"@angular/platform-browser-dynamic": "^16.1.0",
2020
"@angular/router": "^16.1.0",
21-
"ngx-scanner-qrcode": "1.7.3",
21+
"ngx-scanner-qrcode": "1.8.0",
2222
"bootstrap": "5.0.2",
2323
"rxjs": "~7.8.0",
2424
"tslib": "^2.3.0",

src/app/app.component.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,11 @@ export class AppComponent implements AfterViewInit {
5858
}
5959

6060
public handle(action: any, fn: string): void {
61-
// Fix issue #27, #29
62-
const playDeviceFacingBack = (devices: any[]) => {
63-
// front camera or back camera check here!
64-
const device = devices.find(f => (/back|rear|environment/gi.test(f.label))); // Default Back Facing Camera
65-
action.playDevice(device ? device.deviceId : devices[0].deviceId);
66-
}
67-
6861
if (fn === 'start') {
62+
// Fix issue #27, #29
63+
const playDeviceFacingBack = (devices: any[]) => {
64+
action.playDevice(devices?.[0]?.deviceId);
65+
}
6966
action[fn](playDeviceFacingBack).subscribe((r: any) => console.log(fn, r), alert);
7067
} else {
7168
action[fn]().subscribe((r: any) => console.log(fn, r), alert);

0 commit comments

Comments
 (0)