Commit 8d82cec8494429a621534fbd3d7581366f30fcba
1 parent
87991dea
UI: Fixed first init webcamera in iOS device
Showing
1 changed file
with
7 additions
and
0 deletions
@@ -283,6 +283,13 @@ export class PhotoCameraInputWidgetComponent extends PageComponent implements On | @@ -283,6 +283,13 @@ export class PhotoCameraInputWidgetComponent extends PageComponent implements On | ||
283 | window.navigator.mediaDevices.getUserMedia(videoTrackConstraints).then((stream: MediaStream) => { | 283 | window.navigator.mediaDevices.getUserMedia(videoTrackConstraints).then((stream: MediaStream) => { |
284 | if (init) { | 284 | if (init) { |
285 | this.isShowCamera = true; | 285 | this.isShowCamera = true; |
286 | + if (this.availableVideoInputs.find((device) => device.deviceId === '')) { | ||
287 | + PhotoCameraInputWidgetComponent.getAvailableVideoInputs().then((devices) => { | ||
288 | + this.singleDevice = devices.length < 2; | ||
289 | + this.availableVideoInputs = devices; | ||
290 | + this.ctx.detectChanges(); | ||
291 | + }); | ||
292 | + } | ||
286 | } | 293 | } |
287 | this.mediaStream = stream; | 294 | this.mediaStream = stream; |
288 | this.videoElement.srcObject = stream; | 295 | this.videoElement.srcObject = stream; |