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