From 8d82cec8494429a621534fbd3d7581366f30fcba Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 4 Dec 2020 12:03:26 +0200 Subject: [PATCH] UI: Fixed first init webcamera in iOS device --- .../components/widget/lib/photo-camera-input.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/photo-camera-input.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/photo-camera-input.component.ts index aebc500faf..f61f9ef612 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/photo-camera-input.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/photo-camera-input.component.ts @@ -283,6 +283,13 @@ export class PhotoCameraInputWidgetComponent extends PageComponent implements On window.navigator.mediaDevices.getUserMedia(videoTrackConstraints).then((stream: MediaStream) => { if (init) { this.isShowCamera = true; + if (this.availableVideoInputs.find((device) => device.deviceId === '')) { + PhotoCameraInputWidgetComponent.getAvailableVideoInputs().then((devices) => { + this.singleDevice = devices.length < 2; + this.availableVideoInputs = devices; + this.ctx.detectChanges(); + }); + } } this.mediaStream = stream; this.videoElement.srcObject = stream;