capacitor-community / capacitor-community/camera-preview

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'videoWidth')

Open
#236 3 comments 0 reactions 0 assignees View on GitHub
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**
![Screen Shot 2022-07-19 at 10 21 24 PM](https://user-images.githubusercontent.com/3211697/179882257-b8de2937-a928-4189-8d00-62541065fb37.png)

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.