Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
onSubmit(form) {
if (!this.saving) {
this.saving = true;
let video = this.element.nativeElement.querySelector('#video-user');
let canvas = this.element.nativeElement.querySelector('#canvas');
var ctx = canvas.getContext('2d');
ctx.drawImage(video, 0, 0);
this.imagem = canvas.toDataURL("image/jpeg");
this.reconhecimentoService.reconhecer(this.imagem).subscribe(data => {
this.saving = false;
this.router.navigate(['/reconhecimento', data['content'].idVisita], { replaceUrl: true });
}, e => {
this.saving = false;
UiSnackbar.show({
text: 'Ocorreu um erro interno, tente novamente mais tarde.'
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.