File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
client/packages/lowcoder/src/comps/comps/fileComp Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ export const ImageCaptureModal = (props: {
69
69
if ( props . showModal ) {
70
70
setImgSrc ( "" ) ;
71
71
setErrMessage ( "" ) ;
72
+ setVideoConstraints ( { facingMode : "environment" } ) ;
73
+ setDropdownShow ( false ) ;
72
74
}
73
75
} , [ props . showModal ] ) ;
74
76
@@ -119,9 +121,11 @@ export const ImageCaptureModal = (props: {
119
121
) : (
120
122
< Suspense fallback = { < Skeleton /> } >
121
123
< ReactWebcam
124
+ key = { JSON . stringify ( videoConstraints ) }
122
125
ref = { webcamRef }
123
126
onUserMediaError = { handleMediaErr }
124
127
screenshotFormat = "image/jpeg"
128
+ videoConstraints = { videoConstraints }
125
129
/>
126
130
</ Suspense >
127
131
) }
@@ -167,9 +171,10 @@ export const ImageCaptureModal = (props: {
167
171
popupRender = { ( ) => (
168
172
< Menu
169
173
items = { modeList }
170
- onClick = { ( value ) =>
171
- setVideoConstraints ( { ...videoConstraints , deviceId : value . key } )
172
- }
174
+ onClick = { ( value ) => {
175
+ setVideoConstraints ( { deviceId : { exact : value . key } } ) ;
176
+ setDropdownShow ( false ) ;
177
+ } }
173
178
/>
174
179
) }
175
180
>
You can’t perform that action at this time.
0 commit comments