File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/BootstrapBlazor/Components/Camera Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -136,22 +136,18 @@ export function download(id, fileName) {
136136 createEl . remove ( ) ;
137137}
138138
139- export function resize ( id , width , height ) {
139+ export async function resize ( id , width , height ) {
140140 const camera = Data . get ( id )
141141 if ( camera === null || camera . video === void 0 ) {
142142 return
143143 }
144144
145145 const constrains = {
146- video : {
147- deviceId : camera . video . deviceId ,
148- width : { ideal : width } ,
149- height : { ideal : height }
150- }
146+ facingMode : "environment" ,
147+ width : { ideal : width } ,
148+ height : { ideal : height }
151149 }
152-
153- stopDevice ( camera )
154- play ( camera , constrains )
150+ await camera . video . track . applyConstraints ( constrains ) ;
155151}
156152
157153export function dispose ( id ) {
You can’t perform that action at this time.
0 commit comments