Browse Source
Merge pull request #3808 from vvlladd28/improvement/mac/video-camera
UI: Fixed first init webcamera in iOS device
pull/3810/head
Igor Kulikov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
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; |
|
|
|
|