File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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 => ( / b a c k | r e a r | e n v i r o n m e n t / 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 ) ;
You can’t perform that action at this time.
0 commit comments