Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.scanFailure = new EventEmitter();
this.scanError = new EventEmitter();
this.scanComplete = new EventEmitter();
this.camerasFound = new EventEmitter();
this.camerasNotFound = new EventEmitter();
this.permissionResponse = new EventEmitter();
this.hasDevices = new EventEmitter();
this.deviceChange = new EventEmitter();
// computed data
this._hints = new Map();
this.hasNavigator = typeof navigator !== 'undefined';
this.isMediaDevicesSuported = this.hasNavigator && !!navigator.mediaDevices;
// will start codeReader if needed.
this.formats = [BarcodeFormat.QR_CODE];
}
this.scanSuccess = new EventEmitter();
this.scanFailure = new EventEmitter();
this.scanError = new EventEmitter();
this.scanComplete = new EventEmitter();
this.camerasFound = new EventEmitter();
this.camerasNotFound = new EventEmitter();
this.permissionResponse = new EventEmitter(true);
this.hasDevices = new EventEmitter();
this.deviceChange = new EventEmitter();
this._device = null;
this._enabled = true;
this._hints = new Map();
this.autofocusEnabled = true;
this.autostart = true;
this.formats = [BarcodeFormat.QR_CODE];
// computed data
this.hasNavigator = typeof navigator !== 'undefined';
this.isMediaDevicesSuported = this.hasNavigator && !!navigator.mediaDevices;
}
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
availableDevices: MediaDeviceInfo[];
currentDevice: MediaDeviceInfo = null;
formatsEnabled: BarcodeFormat[] = [
BarcodeFormat.CODE_128,
BarcodeFormat.DATA_MATRIX,
BarcodeFormat.EAN_13,
BarcodeFormat.QR_CODE,
];
hasDevices: boolean;
hasPermission: boolean;
qrResultString: string;
torchEnabled = false;
torchAvailable$ = new BehaviorSubject(false);
tryHarder = false;
constructor(private readonly _dialog: MatDialog) { }
clearResult(): void {
this.qrResultString = null;
}