From 3eaafa1933116d0364f8286d5edf8f413688e216 Mon Sep 17 00:00:00 2001 From: MarcZierle Date: Thu, 20 Jan 2022 17:08:00 +0100 Subject: [PATCH] fix camera facing mode --- src/views/CameraCapture.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/CameraCapture.vue b/src/views/CameraCapture.vue index 2da1201..8bcfa65 100644 --- a/src/views/CameraCapture.vue +++ b/src/views/CameraCapture.vue @@ -180,7 +180,9 @@ export default { const constraints = (window.constraints = { audio: false, - video: true + video: { + facingMode: 'environment' + } }) navigator.mediaDevices.getUserMedia(constraints).then((stream) => { @@ -231,7 +233,13 @@ export default { const file = dataURLtoFile(this.photo.src, 'upload.png') - addNewPhoto(file, null, this.selected_group) + addNewPhoto(file, null, this.selected_group).then(() => { + this.message.success('Done!') + this.isPhotoTaken = false + this.showPhotoTakenModal = false + }).catch((error) => { + this.message.error('There was an error uploading the photo: ' + error) + }) }, }, }