Changed logic in ocr for capture
This commit is contained in:
@@ -203,6 +203,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
try {
|
try {
|
||||||
this.stream = await navigator.mediaDevices.getUserMedia({
|
this.stream = await navigator.mediaDevices.getUserMedia({
|
||||||
video: {
|
video: {
|
||||||
|
facingMode: this.currentFacingMode, // 'user' or 'environment'
|
||||||
width: { ideal: 1920 },
|
width: { ideal: 1920 },
|
||||||
height: { ideal: 1080 },
|
height: { ideal: 1080 },
|
||||||
},
|
},
|
||||||
@@ -215,6 +216,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async switchCamera() {
|
async switchCamera() {
|
||||||
this.currentFacingMode = this.currentFacingMode === 'user' ? 'environment' : 'user';
|
this.currentFacingMode = this.currentFacingMode === 'user' ? 'environment' : 'user';
|
||||||
await this.initCamera();
|
await this.initCamera();
|
||||||
|
|||||||
Reference in New Issue
Block a user