capacitor-community / capacitor-community/camera-preview

Capacitor 6 and Camera Preview 6, on Ionic 8, Android Native CameraPreview.startRecordingVideo() bug

Open
#351 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
227
Forks
185
PR merge metrics
No merged PRs in 30d

Description

There are multiple bugs when using the Android Native Camera Preview plugin.

**Bug 1: Camera Preview Options - toBack Property**
Description: When initializing the Camera Preview Options, setting the toBack property to true allows the live video preview feed to be displayed but hides the control buttons. Conversely, setting toBack to false makes the controls visible, but the live video preview feed is not displayed.

Impact: This issue prevents users from interacting with controls while viewing the camera preview, leading to a poor user experience.

**Bug 2: Undefined Result on Video Recording**
Description: When calling CameraPreview.startRecordVideo(options), the result returned is undefined. Consequently, when attempting to call CameraPreview.stopRecordVideo(), the result is empty.

Impact: This bug makes it impossible to retrieve or handle recorded video data, hindering functionality related to video recording and playback.

Here are the logs:

CP - handleVideoButtonClick called
chat.page.ts:407 CP - Video recorder is now visible.
VM3:372 native Camera.checkPermissions (#55622006)
VM3:379 ObjectcallbackId: "55622006"methodName: "checkPermissions"options: {}pluginId: "Camera"[[Prototype]]: Object
VM3:346 result Camera.checkPermissions (#55622006)
VM3:357 Objectcamera: "granted"photos: "granted"readExternalStorage: "denied"saveGallery: "denied"[[Prototype]]: Object
VM3:372 native CameraPreview.start (#55622007)
VM3:379 ObjectcallbackId: "55622007"methodName: "start"options: {position: 'rear', parent: 'cameraPreview', className: 'cameraPreview', x: 0, y: 0, …}pluginId: "CameraPreview"[[Prototype]]: Object
**VM3:346 result CameraPreview.start (#55622007)
VM3:357 undefined
VM3:372 native CameraPreview.startRecordVideo (#55622008)
VM3:379 ObjectcallbackId: "55622008"methodName: "startRecordVideo"options: {x: 0, y: 0, width: 360, height: 726, position: 'front', …}pluginId: "CameraPreview"[[Prototype]]: Object
VM3:346 result CameraPreview.startRecordVideo (#55622008)
VM3:357 undefined
video-recorder.component.ts:183 VRC - Native video recording started
VM3:372 native CameraPreview.stopRecordVideo (#55622009)
VM3:379 ObjectcallbackId: "55622009"methodName: "stopRecordVideo"options: {}pluginId: "CameraPreview"[[Prototype]]: Object**
VM3:346 result CameraPreview.stopRecordVideo (#55622009)

AndroidManifes.xml Permissions :









dependencies :

"@capacitor-community/camera-preview": "^6.0.0",
"@capacitor/android": "6.1.1",
"@capacitor/angular": "^2.0.3",
"@capacitor/app": "6.0.0",
"@capacitor/camera": "^6.0.2",
"@capacitor/core": "^6.1.1",
"@ionic/angular": "^8.2.6",

devDependencies :

"@angular/cli": "^17.2.0",
"@angular/compiler-cli": "^17.2.0",
"@angular/language-service": "^17.2.0",
"@capacitor/cli": "6.1.1",

Device :

Samsung S21

![Camera Preview Native Android Device](https://github.com/user-attachments/assets/8c9741f9-eac9-43ea-9abb-0f858ca28cc3)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.