fix camera facing mode

This commit is contained in:
MarcZierle 2022-01-20 17:08:00 +01:00
parent 2597014525
commit 3eaafa1933

View File

@ -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)
})
},
},
}