UI: Fixed first init webcamera in iOS device
This commit is contained in:
parent
87991deaf7
commit
8d82cec849
@ -283,6 +283,13 @@ export class PhotoCameraInputWidgetComponent extends PageComponent implements On
|
|||||||
window.navigator.mediaDevices.getUserMedia(videoTrackConstraints).then((stream: MediaStream) => {
|
window.navigator.mediaDevices.getUserMedia(videoTrackConstraints).then((stream: MediaStream) => {
|
||||||
if (init) {
|
if (init) {
|
||||||
this.isShowCamera = true;
|
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.mediaStream = stream;
|
||||||
this.videoElement.srcObject = stream;
|
this.videoElement.srcObject = stream;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user