capacitor-community / capacitor-community/camera-preview
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'videoWidth')
- Dominant language
- Java
- Stars
- 227
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Sample video code does not work. Cannot read videoWidth.
```javascript
const cameraPreviewOptions: CameraPreviewOptions = {
position: 'rear',
parent: 'cameraPreview',
className: 'cameraPreview',
height: this.height,
width: this.width
};
CameraPreview.start(cameraPreviewOptions);
const cameraSampleOptions: CameraSampleOptions = {
quality: 50
};
while(this.isActive) {
const image = await CameraPreview.captureSample(cameraSampleOptions)
console.log(image.value)
}
```
**To Reproduce**
Steps to reproduce the behavior:
1. Run sample video code
2. Open in browser
**Expected behavior**
I expected a frame of the video to be captured.
**Desktop (please complete the following information):**
- OS: macOS Monterey
- Brave
- Version 1.41.96 Chromium 103.0.5060.114
**Smartphone (please complete the following information):**
- Device: Samsung
- OS: Android Galaxy S10+
**Additional context**

Contributor guide
Assessment
This issue has not been assessed yet.