diff --git a/CameraKit/entry/src/main/ets/pages/GetFrontCameraImage.ets b/CameraKit/entry/src/main/ets/pages/GetFrontCameraImage.ets index 41a98e774608dd4bb234e3849bd71c0a9a2263d4..41a06e9391dbe4b894f92bdcc714311fb4cec2a4 100644 --- a/CameraKit/entry/src/main/ets/pages/GetFrontCameraImage.ets +++ b/CameraKit/entry/src/main/ets/pages/GetFrontCameraImage.ets @@ -40,11 +40,11 @@ struct GetFrontCameraImage { }); // 2、Create and start a physical camera input stream channel // Set as front camera camera.CameraPosition.CAMERA_POSITION_FRONT - let fontCamera = camerasInfo.find(cam => cam.cameraPosition === camera.CameraPosition.CAMERA_POSITION_FRONT); - let cameraInput = cameraManager.createCameraInput(fontCamera); + let frontCamera = camerasInfo.find(cam => cam.cameraPosition === camera.CameraPosition.CAMERA_POSITION_FRONT); + let cameraInput = cameraManager.createCameraInput(frontCamera); await cameraInput.open(); // 3、Retrieve the physical camera information and query the output formats supported by the preview stream of the camera. Create a preview output channel by combining it with the surfaceId provided by XComponent - let outputCapability = cameraManager.getSupportedOutputCapability(fontCamera, camera.SceneMode.NORMAL_PHOTO); + let outputCapability = cameraManager.getSupportedOutputCapability(frontCamera, camera.SceneMode.NORMAL_PHOTO); let previewProfile = outputCapability.previewProfiles[0]; let surfaceId = this.xComponentController.getXComponentSurfaceId(); let previewOutput = cameraManager.createPreviewOutput(previewProfile, surfaceId);