UI: Fixed first init webcamera in iOS device

This commit is contained in:
Vladyslav_Prykhodko 2020-12-04 12:03:26 +02:00
parent 87991deaf7
commit 8d82cec849

View File

@ -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;