|
|
@ -117,6 +117,7 @@ export class PhotoCameraInputWidgetComponent extends PageComponent implements On |
|
|
updatePhoto = false; |
|
|
updatePhoto = false; |
|
|
previewPhoto: SafeUrl; |
|
|
previewPhoto: SafeUrl; |
|
|
lastPhoto: SafeUrl; |
|
|
lastPhoto: SafeUrl; |
|
|
|
|
|
datasourceDetected = false; |
|
|
|
|
|
|
|
|
private static hasGetUserMedia(): boolean { |
|
|
private static hasGetUserMedia(): boolean { |
|
|
return !!(window.navigator.mediaDevices && window.navigator.mediaDevices.getUserMedia); |
|
|
return !!(window.navigator.mediaDevices && window.navigator.mediaDevices.getUserMedia); |
|
|
@ -148,14 +149,16 @@ export class PhotoCameraInputWidgetComponent extends PageComponent implements On |
|
|
|
|
|
|
|
|
this.width = this.settings.maxWidth ? this.settings.maxWidth : 640; |
|
|
this.width = this.settings.maxWidth ? this.settings.maxWidth : 640; |
|
|
this.height = this.settings.maxHeight ? this.settings.maxWidth : 480; |
|
|
this.height = this.settings.maxHeight ? this.settings.maxWidth : 480; |
|
|
|
|
|
this.datasourceDetected = this.ctx.datasources?.length !== 0; |
|
|
if (this.datasource.type === DatasourceType.entity) { |
|
|
if (this.datasourceDetected) { |
|
|
if (this.datasource.entityType && this.datasource.entityId) { |
|
|
if (this.datasource.type === DatasourceType.entity) { |
|
|
this.isEntityDetected = true; |
|
|
if (this.datasource.entityType && this.datasource.entityId) { |
|
|
|
|
|
this.isEntityDetected = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (this.datasource.dataKeys.length) { |
|
|
|
|
|
this.dataKeyDetected = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.datasource.dataKeys.length) { |
|
|
|
|
|
this.dataKeyDetected = true; |
|
|
|
|
|
} |
|
|
} |
|
|
this.detectAvailableDevices(); |
|
|
this.detectAvailableDevices(); |
|
|
} |
|
|
} |
|
|
|