diff --git a/src/pages/detect.vue b/src/pages/detect.vue index a0f7adb..5a7794b 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -7,7 +7,11 @@
- + +
+ + Capture +
- + @@ -321,7 +325,9 @@ uploadUid: null, uploadDirty: false, modelLocation: '', - modelLoading: false + modelLoading: false, + videoAvailable: false, + cameraStream: null } }, setup() { @@ -573,8 +579,24 @@ f7.dialog.alert(`Error loading image: ${e.message}`) }) }, - videoStream() { + async videoStream() { //TODO + navigator.mediaDevices.getUserMedia({video: true}) + var vidConstraint = { + video: { + width: { + ideal: 1920 + }, + height: { + ideal: 1080 + }, + facingMode: 'environment' + }, + audio: false + } + const stream = await navigator.mediaDevices.getUserMedia(vidConstraint); + this.videoAvailable = true + this.cameraStream = stream return null }, async submitData () {