Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pullpushtree opened this issue Nov 21, 2024 · 0 comments

Comments

@pullpushtree
Copy link

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 :

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant