Feature: context-based default camera

- Specify the default camera (front / back) to use
This commit is contained in:
Jose Olarte III
2025-05-27 15:37:45 +08:00
parent aeb771f619
commit 033ef2297d
3 changed files with 8 additions and 1 deletions

View File

@@ -271,6 +271,11 @@ const inputImageFileNameRef = ref<Blob>();
type: Boolean,
default: true,
},
defaultCameraMode: {
type: String,
default: 'environment',
validator: (value: string) => ['environment', 'user'].includes(value)
}
},
})
export default class ImageMethodDialog extends Vue {
@@ -378,6 +383,7 @@ export default class ImageMethodDialog extends Vue {
this.crop = !!crop;
this.imageCallback = setImageFn;
this.visible = true;
this.currentFacingMode = this.defaultCameraMode as 'environment' | 'user';
// Start camera preview immediately if not on mobile
if (!this.platformCapabilities.isNativeApp) {

View File

@@ -115,6 +115,7 @@
<ImageMethodDialog
ref="imageMethodDialog"
:is-registered="isRegistered"
default-camera-mode="user"
/>
</div>
<div class="mt-4">

View File

@@ -93,7 +93,7 @@
/>
</span>
</div>
<ImageMethodDialog ref="imageDialog" />
<ImageMethodDialog ref="imageDialog" default-camera-mode="environment" />
<div class="mt-4 flex justify-between gap-2">
<!-- First Column for Giver -->