camera-preview
camera-preview copied to clipboard
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'videoWidth')
Describe the bug Sample video code does not work. Cannot read videoWidth.
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:
- Run sample video code
- 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
I get an occasional error just like this with my PWA, but I'm using Capture, not captureSample. Any answers?
+1 i get this in Capture and captureSample.
same error for me as well, any update ??