Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit() {
WebcamUtil.getAvailableVideoInputs()
.then((mediaDevices: MediaDeviceInfo[]) => {
this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
});
// Use enter key to get the current snapshot
// tslint:disable-next-line:only-arrow-functions
document.body.addEventListener('keypress', function(event) {
if (event.keyCode === 13) {
console.log('You pressed Enter key.');
document.getElementById('buttonSnapshot').click();
}
});
this.loadAudio();
this.stageId = 1;
public ngOnInit(): void {
WebcamUtil.getAvailableVideoInputs()
.then((mediaDevices: MediaDeviceInfo[]) => {
this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
});
}